Commits

ZyX_I committed bab80a1

Moved some check-related code to fwctests.dat

Comments (0)

Files changed (2)

test/fwctests.dat

 ['<- <- ->>',            'check'], range(1), 0
 #▶1 Pipes
 #▶2 Function pipes
+\function s:.revstring(str)
+\    return join(reverse(split(a:str, '\v.@=')), '')
+:endfunction
 ['|*$"string"',                'filter'], ['abc'], ["'abc'"]
 ["|*$'string'",                'filter'], ['abc'], ["'abc'"]
 ['|*=function("string")',      'filter'], ['abc'], ["'abc'"]
 ['isfunc',                 'filter'], [0],                  0
 ['isfunc',                 'filter'], [function("tr")],     [function("tr")]
 #▶3 Substitute
+:let s:regex='\v.'
+:let s:replacement='def'
+:let s:flags='g'
 ['substitute/abc/"def"""', 'filter'], ['abc'],              ['def']
 ['substitute/abc/"def"""', 'filter'], [0],                  0
 ['substitute/abc/"def"g',  'filter'], ['abcabc'],           ['defdef']
 ['|=string(@.@)|=string(@.@)', 'filter'], ['abc'], ["'''abc'''"]
 #▶1 Checks
 #▶2 Function checks
+\function s:.ordered(str)
+\    return join(sort(split(a:str, '\v.@=')), '') is a:str
+:endfunction
 ['?*$"empty"', 'check'], ['abc'], 0
 ['?*$"empty"', 'check'], [''],    1
 ['?*ordered',  'check'], ['abc'], 1
 ['_',               'check'], [[[[]]]],             1
 ['any',             'check'], [[[[]]]],             1
 #▶3 haskey
+:let s:k1='def'
 ['haskey abc',      'check'], [""],                 0
 ['haskey abc',      'check'], [{}],                 0
 ['haskey abc, def', 'check'], [{}],                 0

test/rtp/plugin/fwccheck.vim

 execute frawor#Setup('0.0', {'@/fwc/compiler': '0.0'}, 1)
-let tests=map(filter(readfile('fwctests.dat'), 'v:val[0] isnot "#"'),
-            \ 'eval("[".v:val."]")')
 let i=1
 let j=1
 let sections=[]
 let prevsections=[]
-function s:.revstring(str)
-    return join(reverse(split(a:str, '\v.@=')), '')
-endfunction
-function s:.ordered(str)
-    return join(sort(split(a:str, '\v.@=')), '') is a:str
-endfunction
-let s:regex='\v.'
-let s:replacement='def'
-let s:flags='g'
-let s:k1='def'
+let toexecute=""
 for line in readfile('fwctests.dat')
     if empty(line)
         continue
             let i=1
         endif
         continue
+    elseif line[0] is ':'
+        execute toexecute."\n".line[1:]
+        let toexecute=""
+        continue
+    elseif line[0] is '\'
+        let toexecute.="\n".line[1:]
+        continue
     elseif !empty($DEBUGTEST) && j!=$DEBUGTEST
         let i+=1
         let j+=1