aurum / test / globtopattern.vim

execute frawor#Setup('0.0', {'@aurum/edit': '0.0'})
let files=[
            \'.hgignore',
            \'aurum-addon-info.txt',
            \'doc/aurum.txt',
            \'ftplugin/aurumannotate.vim',
            \'ftplugin/aurumcommit.vim',
            \'ftplugin/aurumlog.vim',
            \'ftplugin/aurumstatus.vim',
            \'plugin/aurum.vim',
            \'plugin/aurum/annotate.vim',
            \'plugin/aurum/bufvars.vim',
            \'plugin/aurum/cmdutils.vim',
            \'plugin/aurum/commit.vim',
            \'plugin/aurum/drivers/mercurial.vim',
            \'plugin/aurum/log.vim',
            \'plugin/aurum/record.vim',
            \'plugin/aurum/repo.vim',
            \'plugin/aurum/status.vim',
            \'plugin/aurum/vimdiff.vim',
            \'python/aurum.py',
            \'syntax/aurumannotate.vim',
            \'syntax/aurumlog.vim',
            \'syntax/aurumstatus.vim',
            \'test/addmessages.vim',
            \'test/annotate-buffers.in',
            \'test/annotate-buffers.ok',
            \'test/annotate.in',
            \'test/annotate.ok',
            \'test/annotatemaps.in',
            \'test/annotatemaps.ok',
            \'test/audiffmaps.in',
            \'test/audiffmaps.ok',
            \'test/aufilemaps.in',
            \'test/aufilemaps.ok',
            \'test/commit.in',
            \'test/commit.ok',
            \'test/copyout-postproc.zsh',
            \'test/createrepo.zsh',
            \'test/diff.in',
            \'test/diff.ok',
            \'test/file.in',
            \'test/file.ok',
            \'test/gentests-expand-tmpdir.zsh',
            \'test/gentests-setuprtp.zsh',
            \'test/gentests-setuptestrepos.zsh',
            \'test/gentests-unnormdates.zsh',
            \'test/log.in',
            \'test/log.ok',
            \'test/logmaps.in',
            \'test/logmaps.ok',
            \'test/prevmessage.in',
            \'test/prevmessage.ok',
            \'test/record.in',
            \'test/record.ok',
            \'test/runtime.tar.xz',
            \'test/stat.in',
            \'test/stat.ok',
            \'test/statmaps.in',
            \'test/statmaps.ok',
            \'test/testrepo.tar.xz',
            \'test/update.in',
            \'test/update.ok',
            \'test/vimdiff-usewin.in',
            \'test/vimdiff-usewin.ok',
            \'test/vimdiff.in',
            \'test/vimdiff.ok',
            \'test/vimrc',
            \'test/{}',
            \'test/{this',
            \'test/{this,that}',
            \'test/}}',
            \'test/[',
            \'test/]',
            \'test/^.vim',
        \]
let failfile=curtest.'.fail'
for [g, r] in [['plugin/*.vim',                    ['plugin/aurum.vim']],
            \  ['plugin/{*.vim,aurum/{s,v}*.vim}', ['plugin/aurum.vim',
            \                                       'plugin/aurum/status.vim',
            \                                       'plugin/aurum/vimdiff.vim',
            \                                      ]],
            \  ['plugin/{*.vim,aurum/[sv]*.vim}',  ['plugin/aurum.vim',
            \                                       'plugin/aurum/status.vim',
            \                                       'plugin/aurum/vimdiff.vim',
            \                                      ]],
            \  ['python/[!a]*.py',                 []],
            \  ['**.py',                           ['python/aurum.py']],
            \  ['**/.py',                          []],
            \  ['**/*.txt',                        ['aurum-addon-info.txt',
            \                                       'doc/aurum.txt']],
            \  ['python',                          ['python/aurum.py']],
            \  ['python/',                         ['python/aurum.py']],
            \  ['python////',                      ['python/aurum.py']],
            \  ['test/{*',                         ['test/{}',
            \                                       'test/{this',
            \                                       'test/{this,that}']],
            \  ['test/{*,*',                       ['test/{this,that}']],
            \  ['test/}}',                         ['test/}}']],
            \  ['test/[',                          ['test/[']],
            \  ['test/]',                          ['test/]']],
            \  ['test/[^u]*',                      ['test/update.in',
            \                                       'test/update.ok',
            \                                       'test/^.vim']],
            \]
    let p=s:_r.globtopat(g)
    let rr=filter(copy(files), 'v:val=~#p')
    if rr !=# r
        call writefile([g, p, string(r), string(rr)], failfile)
        echom 'Failed '.g.':'
        echom 'expected '.join(r).','
        echom 'but got '.join(rr)
        echom 'computed pattern: '.p.'.'
        break
    endif
endfor
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.