frawor / test / rtp / plugin / base64.vim

ZyX_I 9bef657 
ZyX_I 3260979 







ZyX_I b3ac7ea 

ZyX_I 3260979 



ZyX_I b3ac7ea 







ZyX_I 3260979 





ZyX_I b3ac7ea 












ZyX_I 3260979 



execute frawor#Setup('0.0', {'@/base64': '0.0'})
W: Testing base64. Test should not output anything
let tests=[
            \['', ''],
            \['QQ==', 'A'],
            \['QUJ=', 'AB'],
            \['QUJD', 'ABC'],
            \['QUJDRA==', 'ABCD'],
            \["AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIj\nJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZH\nSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWpr\nbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6P\nkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq+wsbKz\ntLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX\n2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7\n/P3+/w==                                        ",
            \ range(0, 0xFF)],
            \['QUJDAApBQkMAREVGCgBBQkM=', ["ABC\n", "ABC\nDEF", "\nABC"]],
        \]
let i=0
for [in, out] in tests
    if type(out)==type([])
        if type(out[0])==type('')
            let d=s:_r.base64.decodelines(in)
            let e=s:_r.base64.encodelines(d)
            let d2=s:_r.base64.decodelines(e)
        else
            let d=s:_r.base64.decode(in, 1)
            let e=s:_r.base64.encode(d)
            let d2=s:_r.base64.decode(e, 1)
        endif
    else
        let d=s:_r.base64.decode(in)
        let e=s:_r.base64.encode(d)
        let d2=s:_r.base64.decode(e)
    endif
    if d!=#out
        echom 'Failed '.i.':'
        echom ' in: '.in
        echom '  d: '.string(d)
        echom 'out: '.string(out)
    endif
    if d2!=#out
        echom 'Failed(2) '.i.':'
        echom ' in: '.in
        echom '  d: '.string(d)
        echom 'out: '.string(out)
    endif
    unlet d e d2
    unlet in out
    let i+=1
endfor
unlet i
let base64=s:_r.base64
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.