Source

frawor / test / gentests-strange-filenames.zsh

#!/bin/zsh
emulate -LR zsh
setopt bsdecho
typeset -a chars
typeset -A charnames
if [[ ${TESTTYPE[-4,-1]} == wine ]] ; then
    set -A chars $' '
    typeset -gr TESTDIR='T:\test'
else
    set -A chars $' ' $'\n'
    charnames[${chars[2]}]=newline
    typeset -gr TESTDIR="${PWD:A}"
fi
charnames[${chars[1]}]=space
nl=$'\n'
: ${TESTRTP:=${PWD:A}}
for char in $chars ; do
    rtp="${TESTDIR}/rtp$char"
    rtp="${${(qqq)rtp}//$nl/\\n}"
    realrtp="${PWD:A}/rtp$char"
    mkdir -p "$realrtp/plugin"
    cp rtp/plugin/register-return-value.vim "$realrtp/plugin"
    echo > register-return-value-with-${charnames[$char]}.in "\
:let g:testfile='plugin/register-return-value.vim'
:let &rtp.=','.$rtp
:source test.vim"
    cp rtp/plugin/register-return-value.vim \
        "$realrtp/plugin/register-return-value$char.vim"
    echo > register-return-value-with-${charnames[$char]}-in-scriptname.in "\
:let g:testfile=\"plugin/register-return-value${char//$nl/\\n}.vim\"
:let &rtp.=','.$rtp
:source test.vim"
done
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.