java/testScript

timestamp = timestamp(
 );
writeTestFiles = removeTestFiles(
 );
remove writeTestFiles;
writeTestFiles = writeTestFiles(
   'eins\elf.tst1'
 , 'eins\zwoelf.tst1'
 , 'zwei/zwanz/f201'
 , 'zwei/zwanz/f202'
 );
writeTestFiles = removeTestFiles(
 );
remove writeTestFiles;
test dConst comp 'd':
   'data line eins mit text'
 , '    und zwei    '
 , 'das genügt doch wohl! '
;
compare:
   '--- --- test begin dConst comp d >>> 3 lines'
 , '--- compile data: 3 lines: data line eins mit text'
 , '--- run without input'
 , 'data line eins mit text'
 , '    und zwei    '
 , 'das genügt doch wohl! '
 , '--- run with 3 inputs'
 , 'data line eins mit text'
 , '    und zwei    '
 , 'das genügt doch wohl! '
;
test dConst2 comp 'd':
   'a'
 , 'b'
 , ''
 , 'd'
 , ''
 , ' '
 , 'g.'
;
compare:
   '--- --- test begin dConst2 comp d >>> 7 lines'
 , '--- compile data: 7 lines: a'
 , '--- run without input'
 , 'a'
 , 'b'
 , ''
 , 'd'
 , ''
 , ' '
 , 'g.'
 , '--- run with 3 inputs'
 , 'a'
 , 'b'
 , ''
 , 'd'
 , ''
 , ' '
 , 'g.'
;
test dComment comp 'd':
   'data line $*( mit kommentar 1 $*)eins $*( und $*( geschateltem $*) kommentar $*)mit text'
 , '    und zwei    $** eol komment $*) $*(  '
 , 'das $*+ eol incl kommentar   '
 , '$*(  $"$*)"sdf $*)genügt doch wohl! '
;
compare:
   '--- --- test begin dComment comp d >>> 4 lines'
 , '--- compile data: 4 lines: data line $*( mit kommentar 1 $*)eins $*( und $*( geschateltem $*) kommentar $*)mit text'
 , '--- run without input'
 , 'data line eins mit text'
 , '    und zwei    '
 , 'das genügt doch wohl! '
 , '--- run with 3 inputs'
 , 'data line eins mit text'
 , '    und zwei    '
 , 'das genügt doch wohl! '
;
test dString comp 'd':
   'data $"String darf auch $, $$, $*( enthalten".'
 , ' apoString $'' $ $? $$$'' '
 , '$" doppel quotes ""2 """"4 '' ''''$" und apo $'' doppelt ''''2 ''''''''4 oder "1 ""2 $$$''!!!'
;
compare:
   '--- --- test begin dString comp d >>> 3 lines'
 , '--- compile data: 3 lines: data $"String darf auch $, $$, $*( enthalten".'
 , '--- run without input'
 , 'data String darf auch $, $$, $*( enthalten.'
 , ' apoString  $ $? $$$ '
 , ' doppel quotes "2 ""4 '' ''''$ und apo  doppelt ''2 ''''4 oder "1 ""2 $$$!!!'
 , '--- run with 3 inputs'
 , 'data String darf auch $, $$, $*( enthalten.'
 , ' apoString  $ $? $$$ '
 , ' doppel quotes "2 ""4 '' ''''$ und apo  doppelt ''2 ''''4 oder "1 ""2 $$$!!!'
;
test dJava comp 'd':
   'data $('
  +java('dJava0', '"ab" + ')
  +'$*+'
 , java('dJava1', '  "cd" + (3*4) + ')
  +'$-[  efg   $] + $"end"$)'
;
compare:
   '--- --- test begin dJava comp d >>> 2 lines'
 , '--- compile data: 2 lines: data $('
  +java('dJava0', '"ab" + ')
  +'$*+'
 , '--- run without input'
 , 'data abcd12  efg   end'
 , '--- run with 3 inputs'
 , 'data abcd12  efg   end'
;
test dVars comp 'd':
   'data line 1  '
 , '  $=  v1   =   value of variable v1   '
 , ' v1=$v1: equal ${v1}. '
 , '    $=v2 = zwei  $=v3=drei '
 , ' $=zweidrei $*+ sdf '
 , '= zwei vor drei  '
 , 'v1=$v1, v2=$v2 , v3=$v3, {v2v3} = ${$v2$v3}.'
 , '$''${?  v$(1+1$) }''=${?  v$(1+1$) } $''${?v5}''=${?v5}'
 , '$''${>inp}''=${>inp} inp=$(${?inp} ? $inp : $''<<<inp not defined>>>''$)'
;
compare:
   '--- --- test begin dVars comp d >>> 9 lines'
 , '--- compile data: 9 lines: data line 1  '
 , '--- run without input'
 , 'data line 1  '
 , ' v1=value of variable v1: equal value of variable v1. '
 , 'v1=value of variable v1, v2=zwei , v3=drei, {v2v3} = zwei vor drei.'
 , '${?  v$(1+1$) }=true ${?v5}=false'
 , '--- read 0<<endOfInput>>'
 , '${>inp}=false inp=<<<inp not defined>>>'
 , '--- run with 3 inputs'
 , 'data line 1  '
 , ' v1=value of variable v1: equal value of variable v1. '
 , 'v1=value of variable v1, v2=zwei , v3=drei, {v2v3} = zwei vor drei.'
 , '${?  v$(1+1$) }=true ${?v5}=false'
 , '--- read 0: eins zwei drei'
 , '${>inp}=true inp=eins zwei drei'
;
writeTestFiles = writeTestFiles(
   'eins.dInp'
 );
test dInp comp 'd':
   'text eins $<<eof'
 , 'data $line 1  '
 , 'data line zwei$$ eof'
 , 'eof...auuserhalb data$<'
  +writeTestFiles
  +'\eins.dInp $[...nach $''$<''...eins$]'
;
compare:
   '--- --- test begin dInp comp d >>> 4 lines'
 , '--- compile data: 4 lines: text eins $<<eof'
 , '--- run without input'
 , 'text eins '
 , 'data $line 1  '
 , 'data line zwei$$ eof'
 , '...auuserhalb data'
 , 'test file 0 of 1'
 , 'name = eins.dInp'
 , ']end of test file 0: eins.dInp'
 , '...nach $<...eins'
 , '--- run with 3 inputs'
 , 'text eins '
 , 'data $line 1  '
 , 'data line zwei$$ eof'
 , '...auuserhalb data'
 , 'test file 0 of 1'
 , 'name = eins.dInp'
 , ']end of test file 0: eins.dInp'
 , '...nach $<...eins'
;
test dInp2 comp 'd':
   '$=v1=varEins'
 , 'text zehn $<<[eof'
 , 'data $v1 $=v2=varZwei     '
 , 'data line zwei v2=$v2 $''$$'' eof'
 , 'eof...auuserhalb data elf v1=$v1 v2=$v2'
;
compare:
   '--- --- test begin dInp2 comp d >>> 5 lines'
 , '--- compile data: 5 lines: $=v1=varEins'
 , '--- run without input'
 , 'text zehn '
 , 'data varEins '
 , 'data line zwei v2=varZwei $$ eof'
 , '...auuserhalb data elf v1=varEins v2=varZwei'
 , '--- run with 3 inputs'
 , 'text zehn '
 , 'data varEins '
 , 'data line zwei v2=varZwei $$ eof'
 , '...auuserhalb data elf v1=varEins v2=varZwei'
;
writeTestFiles = removeTestFiles(
 );
remove writeTestFiles;
test dData comp 'd':
   '$$ vor $''$-[ data Ex $]'' $-[         '
 , 'eins'
 , 'zwei vor leer'
 , ''
 , 'vier$]...nach data Ex $$ vor $''$-[ data St $]'' $-[     eins'
 , '    $=v=var<v>expanded  '
 , 'zwei v=$v end'
 , '          $]...nachher'
;
compare:
   '--- --- test begin dData comp d >>> 8 lines'
 , '--- compile data: 8 lines: $$ vor $''$-[ data Ex $]'' $-[         '
 , '--- run without input'
 , 'vor $-[ data Ex $] eins zwei vor leer  vier...nach data Ex'
 , 'vor $-[ data St $]      eins zwei v=var<v>expanded end...nachher'
 , '--- run with 3 inputs'
 , 'vor $-[ data Ex $] eins zwei vor leer  vier...nach data Ex'
 , 'vor $-[ data St $]      eins zwei v=var<v>expanded end...nachher'
;
test sJava comp 's':
   'Env.env().'
 , '       '
  +nl
 , '  '
  +nl
 , '  '
 , '    '
  +nl
  +'   write("write eins"); $; Env.env().write("write zwei read " + Env.env().read());'
;
compare:
   '--- --- test begin sJava comp s >>> 5 lines'
 , '--- compile coSh: 5 lines: Env.env().'
 , '--- run without input'
 , 'write eins'
 , '--- read 0<<endOfInput>>'
 , 'write zwei read null'
 , '--- run with 3 inputs'
 , 'write eins'
 , '--- read 0: eins zwei drei'
 , 'write zwei read eins zwei drei'
;
test sString comp 's':
   'Env.env().write($''write eins in '''' apos $ $$ $$$''+ ";"); $; Env.env().write($"write zwei in "" quotes $ $$ read " + Env.env().read());'
;
compare:
   '--- --- test begin sString comp s >>> 1 lines'
 , '--- compile coSh: 1 lines: Env.env().write($''write eins in '''' apos $ $$ $$$''+ ";"); $; Env.env().write($"write zwei in "" quotes $ $$ read " + Env.env().read());'
 , '--- run without input'
 , 'write eins in '' apos $ $$ $$$;'
 , '--- read 0<<endOfInput>>'
 , 'write zwei in " quotes $ $$ read null'
 , '--- run with 3 inputs'
 , 'write eins in '' apos $ $$ $$$;'
 , '--- read 0: eins zwei drei'
 , 'write zwei in " quotes $ $$ read eins zwei drei'
;
test sJava comp 's':
   'Env.env().'
 , '       '
  +nl
 , '  '
  +nl
 , '  '
 , '    '
  +nl
  +'   write("write eins"); $; Env.env().write("write zwei read " + Env.env().read());'
;
compare:
   '--- --- test begin sJava comp s >>> 5 lines'
 , '--- compile coSh: 5 lines: Env.env().'
 , '--- run without input'
 , 'write eins'
 , '--- read 0<<endOfInput>>'
 , 'write zwei read null'
 , '--- run with 3 inputs'
 , 'write eins'
 , '--- read 0: eins zwei drei'
 , 'write zwei read eins zwei drei'
;
test sString comp 's':
   'Env.env().write($''write eins in '''' apos $ $$ $$$''+ ";"); $; Env.env().write($"write zwei in "" quotes $ $$ read " + Env.env().read());'
;
compare:
   '--- --- test begin sString comp s >>> 1 lines'
 , '--- compile coSh: 1 lines: Env.env().write($''write eins in '''' apos $ $$ $$$''+ ";"); $; Env.env().write($"write zwei in "" quotes $ $$ read " + Env.env().read());'
 , '--- run without input'
 , 'write eins in '' apos $ $$ $$$;'
 , '--- read 0<<endOfInput>>'
 , 'write zwei in " quotes $ $$ read null'
 , '--- run with 3 inputs'
 , 'write eins in '' apos $ $$ $$$;'
 , '--- read 0: eins zwei drei'
 , 'write zwei in " quotes $ $$ read eins zwei drei'
;
test sVars comp 's':
   '$=a1=aEins$=a2=value a2 zwo$$ $( "write a1 = " + $a1 $)$$ a2 = ${a2} '
 , '$=va=a$;$$   var v1 ${  $va$(1*1$) } mit geschachtelem Namen'
;
compare:
   '--- --- test begin sVars comp s >>> 2 lines'
 , '--- compile coSh: 2 lines: $=a1=aEins$=a2=value a2 zwo$$ $( "write a1 = " + $a1 $)$$ a2 = ${a2} '
 , '--- run without input'
 , 'write a1 = aEins'
 , 'a2 = value a2 zwo'
 , 'var v1 aEins mit geschachtelem Namen'
 , '--- run with 3 inputs'
 , 'write a1 = aEins'
 , 'a2 = value a2 zwo'
 , 'var v1 aEins mit geschachtelem Namen'
;
test sBlock comp 's':
   '$$ before block1 $@{'
 , ' $$ in block 1 $@{ $$ in block 1.1 end '
 , '$} $$ in block 1 mid $@{ $$ in block 1.2 end $} $$ in block 1 end $} $$ after block'
;
compare:
   '--- --- test begin sBlock comp s >>> 3 lines'
 , '--- compile coSh: 3 lines: $$ before block1 $@{'
 , '--- run without input'
 , 'before block1'
 , 'in block 1'
 , 'in block 1.1 end'
 , 'in block 1 mid'
 , 'in block 1.2 end'
 , 'in block 1 end'
 , 'after block'
 , '--- run with 3 inputs'
 , 'before block1'
 , 'in block 1'
 , 'in block 1.1 end'
 , 'in block 1 mid'
 , 'in block 1.2 end'
 , 'in block 1 end'
 , 'after block'
;
test sShString comp 's':
   '$$sSHString anfang $-{$$write eins in $-{$$ shString $} after2 $} after1'
;
compare:
   '--- --- test begin sShString comp s >>> 1 lines'
 , '--- compile coSh: 1 lines: $$sSHString anfang $-{$$write eins in $-{$$ shString $} after2 $} after1'
 , '--- run without input'
 , 'sSHString anfang write eins in shString after2 after1'
 , '--- run with 3 inputs'
 , 'sSHString anfang write eins in shString after2 after1'
;
test sBar comp 's':
   'Strings.wc(true); $| Strings.wc(true);'
;
compare:
   '--- --- test begin sBar comp s >>> 1 lines'
 , '--- compile coSh: 1 lines: Strings.wc(true); $| Strings.wc(true);'
 , '--- run without input'
 , '--- read 0<<endOfInput>>'
 , 'counted 0 lines, 0 words, 0 chars'
 , 'counted 1 lines, 7 words, 33 chars'
 , '--- run with 3 inputs'
 , '--- read 0: eins zwei drei'
 , '--- read 1: zehn elf zwölf?'
 , '--- read 2: zwanzig 21 22 23 24 ... 29 und Schluss !'
 , '--- read 3<<endOfInput>>'
 , 'eins zwei drei'
 , 'zehn elf zwölf?'
 , 'zwanzig 21 22 23 24 ... 29 und Schluss !'
 , 'counted 3 lines, 16 words, 69 chars'
 , 'counted 4 lines, 23 words, 104 chars'
;
test sBar2 comp 's':
   'Strings.wc(true); Env.env().write("bef 1. bar"); $| Env.env().write("after 1. bar");Strings.wc(true); Env.env().write("bef 2. bar"); $| Strings.wc(true);'
;
compare:
   '--- --- test begin sBar2 comp s >>> 1 lines'
 , '--- compile coSh: 1 lines: Strings.wc(true); Env.env().write("bef 1. bar"); $| Env.env().write("after 1. bar");Strings.wc(true); Env.env().write("bef 2. bar"); $| Strings.wc(true);'
 , '--- run without input'
 , '--- read 0<<endOfInput>>'
 , 'after 1. bar'
 , 'counted 0 lines, 0 words, 0 chars'
 , 'bef 1. bar'
 , 'counted 2 lines, 10 words, 43 chars'
 , 'bef 2. bar'
 , 'counted 5 lines, 23 words, 100 chars'
 , '--- run with 3 inputs'
 , '--- read 0: eins zwei drei'
 , '--- read 1: zehn elf zwölf?'
 , '--- read 2: zwanzig 21 22 23 24 ... 29 und Schluss !'
 , '--- read 3<<endOfInput>>'
 , 'after 1. bar'
 , 'eins zwei drei'
 , 'zehn elf zwölf?'
 , 'zwanzig 21 22 23 24 ... 29 und Schluss !'
 , 'counted 3 lines, 16 words, 69 chars'
 , 'bef 1. bar'
 , 'counted 5 lines, 26 words, 114 chars'
 , 'bef 2. bar'
 , 'counted 8 lines, 39 words, 172 chars'
;
test sBar3 comp 's':
   'Strings.wc(true); $| Strings.wc(true); $|Strings.wc(true); $|Strings.wc(true); $| Strings.wc(true);    '
;
compare:
   '--- --- test begin sBar3 comp s >>> 1 lines'
 , '--- compile coSh: 1 lines: Strings.wc(true); $| Strings.wc(true); $|Strings.wc(true); $|Strings.wc(true); $| Strings.wc(true);    '
 , '--- run without input'
 , '--- read 0<<endOfInput>>'
 , 'counted 0 lines, 0 words, 0 chars'
 , 'counted 1 lines, 7 words, 33 chars'
 , 'counted 2 lines, 14 words, 67 chars'
 , 'counted 3 lines, 21 words, 102 chars'
 , 'counted 4 lines, 28 words, 138 chars'
 , '--- run with 3 inputs'
 , '--- read 0: eins zwei drei'
 , '--- read 1: zehn elf zwölf?'
 , '--- read 2: zwanzig 21 22 23 24 ... 29 und Schluss !'
 , '--- read 3<<endOfInput>>'
 , 'eins zwei drei'
 , 'zehn elf zwölf?'
 , 'zwanzig 21 22 23 24 ... 29 und Schluss !'
 , 'counted 3 lines, 16 words, 69 chars'
 , 'counted 4 lines, 23 words, 104 chars'
 , 'counted 5 lines, 30 words, 140 chars'
 , 'counted 6 lines, 37 words, 176 chars'
 , 'counted 7 lines, 44 words, 212 chars'
;
timestamp = timestamp(
   'fix'
 );
test sRedirB comp 's':
   '$>#eins '
 , 'Strings.wc(true);'
 , 'Env.env().write("ende '
  +timestamp
  +' #eins");  $; $>#zwei $<#eins    '
 , 'Env.env().write("write '
  +timestamp
  +' eine zeile auf zwei"); Strings.wc(true); $; $<+#eins  $<#zwei '
;
compare:
   '--- --- test begin sRedirB comp s >>> 4 lines'
 , '--- compile coSh: 4 lines: $>#eins '
 , '--- run without input'
 , '--- read 0<<endOfInput>>'
 , 'counted 0 lines, 0 words, 0 chars'
 , 'ende '
  +timestamp
  +' #eins'
 , 'write '
  +timestamp
  +' eine zeile auf zwei'
 , 'counted 0 lines, 0 words, 0 chars'
 , 'ende '
  +timestamp
  +' #eins'
 , 'counted 2 lines, 10 words, 84 chars'
 , '--- run with 3 inputs'
 , '--- read 0: eins zwei drei'
 , '--- read 1: zehn elf zwölf?'
 , '--- read 2: zwanzig 21 22 23 24 ... 29 und Schluss !'
 , '--- read 3<<endOfInput>>'
 , 'eins zwei drei'
 , 'zehn elf zwölf?'
 , 'zwanzig 21 22 23 24 ... 29 und Schluss !'
 , 'counted 3 lines, 16 words, 69 chars'
 , 'ende '
  +timestamp
  +' #eins'
 , 'write '
  +timestamp
  +' eine zeile auf zwei'
 , 'eins zwei drei'
 , 'zehn elf zwölf?'
 , 'zwanzig 21 22 23 24 ... 29 und Schluss !'
 , 'counted 3 lines, 16 words, 69 chars'
 , 'ende '
  +timestamp
  +' #eins'
 , 'counted 5 lines, 26 words, 155 chars'
;
timestamp = timestamp(
   'fix'
 );
test sRedirF comp 's':
   '$>\tmpelieli\eins\sRedirF.eins  '
 , 'Strings.wc(true);'
 , 'Env.env().write("ende '
  +timestamp
  +' eins ");  $; $$ out ... eins $; $<\tmpelieli\eins\sRedirF.eins $; $>\tmpelieli\eins\sRedirF.zwei $<\tmpelieli\eins\sRedirF.eins '
 , 'Env.env().write("write '
  +timestamp
  +' eine zeile auf zwei"); Strings.wc(true); $; $$ out ...eins ...zwei $; $<+\tmpelieli\eins\sRedirF.eins  $<\tmpelieli\eins\sRedirF.zwei '
;
compare:
   '--- --- test begin sRedirF comp s >>> 4 lines'
 , '--- compile coSh: 4 lines: $>\tmpelieli\eins\sRedirF.eins  '
 , '--- run without input'
 , '--- read 0<<endOfInput>>'
 , 'out ... eins'
 , 'counted 0 lines, 0 words, 0 chars'
 , 'ende '
  +timestamp
  +' eins '
 , 'out ...eins ...zwei'
 , 'counted 0 lines, 0 words, 0 chars'
 , 'ende '
  +timestamp
  +' eins '
 , 'write '
  +timestamp
  +' eine zeile auf zwei'
 , 'counted 0 lines, 0 words, 0 chars'
 , 'ende '
  +timestamp
  +' eins '
 , 'counted 2 lines, 10 words, 84 chars'
 , '--- run with 3 inputs'
 , '--- read 0: eins zwei drei'
 , '--- read 1: zehn elf zwölf?'
 , '--- read 2: zwanzig 21 22 23 24 ... 29 und Schluss !'
 , '--- read 3<<endOfInput>>'
 , 'out ... eins'
 , 'eins zwei drei'
 , 'zehn elf zwölf?'
 , 'zwanzig 21 22 23 24 ... 29 und Schluss !'
 , 'counted 3 lines, 16 words, 69 chars'
 , 'ende '
  +timestamp
  +' eins '
 , 'out ...eins ...zwei'
 , 'eins zwei drei'
 , 'zehn elf zwölf?'
 , 'zwanzig 21 22 23 24 ... 29 und Schluss !'
 , 'counted 3 lines, 16 words, 69 chars'
 , 'ende '
  +timestamp
  +' eins '
 , 'write '
  +timestamp
  +' eine zeile auf zwei'
 , 'eins zwei drei'
 , 'zehn elf zwölf?'
 , 'zwanzig 21 22 23 24 ... 29 und Schluss !'
 , 'counted 3 lines, 16 words, 69 chars'
 , 'ende '
  +timestamp
  +' eins '
 , 'counted 5 lines, 26 words, 155 chars'
;
test sHereData comp 's':
   '$<<eins  '
 , 'data line eins'
 , 'data line zwei $$$$$ schluss'
 , 'eins'
;
compare:
   '--- --- test begin sHereData comp s >>> 4 lines'
 , '--- compile coSh: 4 lines: $<<eins  '
 , '--- run without input'
 , 'data line eins'
 , 'data line zwei $$$$$ schluss'
 , '--- run with 3 inputs'
 , 'data line eins'
 , 'data line zwei $$$$$ schluss'
;
timestamp = timestamp(
 );
test sRedirCat comp 's':
   '$>#eins $$ buf eins '
  +timestamp
  +' the only line $; $<+#eins $<<+eof '
 , 'hereData line eins'
 , 'herda line two last'
 , 'eof $<+£$(Env.env().in()$) $<#eins'
;
compare:
   '--- --- test begin sRedirCat comp s >>> 4 lines'
 , '--- compile coSh: 4 lines: $>#eins $$ buf eins '
  +timestamp
  +' the only line $; $<+#eins $<<+eof '
 , '--- run without input'
 , 'buf eins '
  +timestamp
  +' the only line'
 , 'hereData line eins'
 , 'herda line two last'
 , '--- read 0<<endOfInput>>'
 , 'buf eins '
  +timestamp
  +' the only line'
 , '--- run with 3 inputs'
 , 'buf eins '
  +timestamp
  +' the only line'
 , 'hereData line eins'
 , 'herda line two last'
 , '--- read 0: eins zwei drei'
 , 'eins zwei drei'
 , '--- read 1: zehn elf zwölf?'
 , 'zehn elf zwölf?'
 , '--- read 2: zwanzig 21 22 23 24 ... 29 und Schluss !'
 , 'zwanzig 21 22 23 24 ... 29 und Schluss !'
 , '--- read 3<<endOfInput>>'
 , 'buf eins '
  +timestamp
  +' the only line'
;
timestamp = timestamp(
 );
test sRedirRW comp 's':
   'Buf<String> b = new Buf<String>("Zeile eins '
  +timestamp
  +'"); $; $>>£$(b$) $$ zeile zwei '
  +timestamp
  +'$; $<+£$(b$) $<+-£$(Env.env().in()$)$<<eof  '
 , 'zeile drei heredata nach stdIn'
 , 'eof  '
;
compare:
   '--- --- test begin sRedirRW comp s >>> 3 lines'
 , '--- compile coSh: 3 lines: Buf<String> b = new Buf<String>("Zeile eins '
  +timestamp
  +'"); $; $>>£$(b$) $$ zeile zwei '
  +timestamp
  +'$; $<+£$(b$) $<+-£$(Env.env().in()$)$<<eof  '
 , '--- run without input'
 , 'Zeile eins '
  +timestamp
 , 'zeile zwei '
  +timestamp
 , '--- read 0<<endOfInput>>'
 , 'zeile drei heredata nach stdIn'
 , '--- run with 3 inputs'
 , 'Zeile eins '
  +timestamp
 , 'zeile zwei '
  +timestamp
 , '--- read 0: eins zwei drei'
 , 'eins zwei drei'
 , '--- read 1: zehn elf zwölf?'
 , 'zehn elf zwölf?'
 , '--- read 2: zwanzig 21 22 23 24 ... 29 und Schluss !'
 , 'zwanzig 21 22 23 24 ... 29 und Schluss !'
 , '--- read 3<<endOfInput>>'
 , 'zeile drei heredata nach stdIn'
;
test sCatAss comp 's':
   '$=vss=valStrStr $$ vss $vss'
 , '$=vsV=$-{$$ valStrValue$} $$ vsV $vsV'
 , '$= $-{$$ vNs $} =valNameString $$ vNs $vNs'
 , '$= $-{$$ vNV $} =$-{$$valNameValue$} $$ vNV $vNV'
;
compare:
   '--- --- test begin sCatAss comp s >>> 4 lines'
 , '--- compile coSh: 4 lines: $=vss=valStrStr $$ vss $vss'
 , '--- run without input'
 , 'vss valStrStr'
 , 'vsV valStrValue'
 , 'vNs valNameString'
 , 'vNV valNameValue'
 , '--- run with 3 inputs'
 , 'vss valStrStr'
 , 'vsV valStrValue'
 , 'vNs valNameString'
 , 'vNV valNameValue'
;
test sCatWr comp 's':
   '$$ write1 mit $-{$$ nested write. $} und noch mehr text'
 , '$$ write2 mit $-{$$ nested write1 und $-{$$ inner nested write2. $} end1 $} und noch mehr text'
;
compare:
   '--- --- test begin sCatWr comp s >>> 2 lines'
 , '--- compile coSh: 2 lines: $$ write1 mit $-{$$ nested write. $} und noch mehr text'
 , '--- run without input'
 , 'write1 mit nested write. und noch mehr text'
 , 'write2 mit nested write1 und inner nested write2. end1 und noch mehr text'
 , '--- run with 3 inputs'
 , 'write1 mit nested write. und noch mehr text'
 , 'write2 mit nested write1 und inner nested write2. end1 und noch mehr text'
;
timestamp = timestamp(
 );
test sRunD comp 's':
   '$>#dat $<<eof '
 , 'data line 1  $@{$=tst= '
  +timestamp
  +'$} '
 , ' data line 2 mit tst $tst'
 , 'eof $;'
 , '$$ input dat #dat $; $<#dat $;'
 , '$$ compile #dat to cmp $;'
 , '$<#dat $=cmp  = $-cmpData '
 , '$$run cmp'
 , '$@run $cmp'
;
compare:
   '--- --- test begin sRunD comp s >>> 9 lines'
 , '--- compile coSh: 9 lines: $>#dat $<<eof '
 , '--- run without input'
 , 'input dat #dat'
 , 'data line 1  $@{$=tst= '
  +timestamp
  +'$} '
 , ' data line 2 mit tst $tst'
 , 'compile #dat to cmp'
 , 'run cmp'
 , 'data line 1  '
 , ' data line 2 mit tst '
  +timestamp
 , '--- run with 3 inputs'
 , 'input dat #dat'
 , 'data line 1  $@{$=tst= '
  +timestamp
  +'$} '
 , ' data line 2 mit tst $tst'
 , 'compile #dat to cmp'
 , 'run cmp'
 , 'data line 1  '
 , ' data line 2 mit tst '
  +timestamp
;
timestamp = timestamp(
 );
test sRunS comp 's':
   '$>#dat $<<eof '
 , '$$ data line 1 $=tst= '
  +timestamp
  +' '
 , '$$ data line 2 mit tst $tst'
 , 'eof $;'
 , '$$ input dat #dat $; $<#dat $;'
 , '$$ compile #dat to cmp $;'
 , '$<#dat $=cmp  : Run  £   $-cmpData  '
 , '$$run cmp'
 , '$@run $cmp'
;
compare:
   '--- --- test begin sRunS comp s >>> 9 lines'
 , '--- compile coSh: 9 lines: $>#dat $<<eof '
 , '--- run without input'
 , 'input dat #dat'
 , '$$ data line 1 $=tst= '
  +timestamp
  +' '
 , '$$ data line 2 mit tst $tst'
 , 'compile #dat to cmp'
 , 'run cmp'
 , 'data line 1'
 , 'data line 2 mit tst '
  +timestamp
 , '--- run with 3 inputs'
 , 'input dat #dat'
 , '$$ data line 1 $=tst= '
  +timestamp
  +' '
 , '$$ data line 2 mit tst $tst'
 , 'compile #dat to cmp'
 , 'run cmp'
 , 'data line 1'
 , 'data line 2 mit tst '
  +timestamp
;
test sReadInto comp 's':
   'int i; for (i=1; ${> gelesen } ; i++ ) $@{ $$ gelesen $(i$) $gelesen $} $$ total $(i-1$) gelesen'
;
compare:
   '--- --- test begin sReadInto comp s >>> 1 lines'
 , '--- compile coSh: 1 lines: int i; for (i=1; ${> gelesen } ; i++ ) $@{ $$ gelesen $(i$) $gelesen $} $$ total $(i-1$) gelesen'
 , '--- run without input'
 , '--- read 0<<endOfInput>>'
 , 'total 0 gelesen'
 , '--- run with 3 inputs'
 , '--- read 0: eins zwei drei'
 , 'gelesen 1 eins zwei drei'
 , '--- read 1: zehn elf zwölf?'
 , 'gelesen 2 zehn elf zwölf?'
 , '--- read 2: zwanzig 21 22 23 24 ... 29 und Schluss !'
 , 'gelesen 3 zwanzig 21 22 23 24 ... 29 und Schluss !'
 , '--- read 3<<endOfInput>>'
 , 'total 3 gelesen'
;
test sTypeVar comp 's':
   '$=vi£ new Integer(123) $$ vi ${vi : Integer} class $(${vi : Integer}.getClass()$)'
;
compare:
   '--- --- test begin sTypeVar comp s >>> 1 lines'
 , '--- compile coSh: 1 lines: $=vi£ new Integer(123) $$ vi ${vi : Integer} class $(${vi : Integer}.getClass()$)'
 , '--- run without input'
 , 'vi 123 class class java.lang.Integer'
 , '--- run with 3 inputs'
 , 'vi 123 class class java.lang.Integer'
;
test sTypeRW comp 's':
   '$£ 5*7 $@{  Integer [] ia = {12, 13}; $£ ia $|: Integer[] boolean b = ${>ia}; $£ ${ia}.length  $£ ${ia: Integer[]}[1]  $£ $ia [0] $} $|:Integer   while ( ${>abc} ) $@{ $£ $''abc='' + ${abc : Object} + $'': '' + ${abc: Object}.getClass() $} $$ eof read'
;
compare:
   '--- --- test begin sTypeRW comp s >>> 1 lines'
 , '--- compile coSh: 1 lines: $£ 5*7 $@{  Integer [] ia = {12, 13}; $£ ia $|: Integer[] boolean b = ${>ia}; $£ ${ia}.length  $£ ${ia: Integer[]}[1]  $£ $ia [0] $} $|:Integer   while ( ${>abc} ) $@{ $£ $''abc='' + ${abc : Object} + $'': '' + ${abc: Object}.getClass() $} $$ eof read'
 , '--- run without input'
 , 'abc=35: class java.lang.Integer'
 , 'abc=2: class java.lang.Integer'
 , 'abc=13: class java.lang.Integer'
 , 'abc=12: class java.lang.Integer'
 , 'eof read'
 , '--- run with 3 inputs'
 , 'abc=35: class java.lang.Integer'
 , 'abc=2: class java.lang.Integer'
 , 'abc=13: class java.lang.Integer'
 , 'abc=12: class java.lang.Integer'
 , 'eof read'
;
test sInDo comp 's':
   '$=v1=v1Leer$$writing \tmpelieli\eins\cInDo.tst1$; $>\tmpelieli\eins\cInDo.tst1 $<<eof'
 , '$@{$=v1=valueEins$ix $}eins $''$v1'' $v1'
 , 'zwei $''$[1+1)'' $(1+1$)'
 , 'eof $;'
 , '$$ input fn ohne Dollar $;'
 , '$<\tmpelieli\eins\cInDo.tst1$;'
 , 'int ix; for (ix=7; ix<9; ix++) '
 , '{'
 , '$=ix£String.valueOf(ix)'
 , '$$input fn with compile ix $ix $;'
 , '$<$"\tmpelieli\eins\cInDo.tst1" $= runIt =  $-cmpData $;'
 , '$@run $runIt'
 , '}'
 , '$$ after loop ix $ix v1 $v1 !ix $(ix$)'
;
compare:
   '--- --- test begin sInDo comp s >>> 14 lines'
 , '--- compile coSh: 14 lines: $=v1=v1Leer$$writing \tmpelieli\eins\cInDo.tst1$; $>\tmpelieli\eins\cInDo.tst1 $<<eof'
 , '--- run without input'
 , 'writing \tmpelieli\eins\cInDo.tst1'
 , 'input fn ohne Dollar'
 , '$@{$=v1=valueEins$ix $}eins $''$v1'' $v1'
 , 'zwei $''$[1+1)'' $(1+1$)'
 , 'input fn with compile ix 7'
 , 'eins $v1 valueEins7'
 , 'zwei $[1+1) 2'
 , 'input fn with compile ix 8'
 , 'eins $v1 valueEins8'
 , 'zwei $[1+1) 2'
 , 'after loop ix 8 v1 valueEins8 !ix 9'
 , '--- run with 3 inputs'
 , 'writing \tmpelieli\eins\cInDo.tst1'
 , 'input fn ohne Dollar'
 , '$@{$=v1=valueEins$ix $}eins $''$v1'' $v1'
 , 'zwei $''$[1+1)'' $(1+1$)'
 , 'input fn with compile ix 7'
 , 'eins $v1 valueEins7'
 , 'zwei $[1+1) 2'
 , 'input fn with compile ix 8'
 , 'eins $v1 valueEins8'
 , 'zwei $[1+1) 2'
 , 'after loop ix 8 v1 valueEins8 !ix 9'
;
test sData comp 's':
   '$$ line $''$$'' eins $£ "line " + $''$£'' + (1+1) $[line drei data'
 , 'line vier data$[line fuenf [[ $@{$$ line sechs [[{ $[line sieben [[{[$]$}$] '
 , 'line acht [[{[]}] $] $$line neun out end'
;
compare:
   '--- --- test begin sData comp s >>> 3 lines'
 , '--- compile coSh: 3 lines: $$ line $''$$'' eins $£ "line " + $''$£'' + (1+1) $[line drei data'
 , '--- run without input'
 , 'line $$ eins'
 , 'line $£2'
 , 'line drei data'
 , 'line vier data'
 , 'line fuenf [[ '
 , 'line sechs [[{'
 , 'line sieben [[{['
 , 'line acht [[{[]}] '
 , 'line neun out end'
 , '--- run with 3 inputs'
 , 'line $$ eins'
 , 'line $£2'
 , 'line drei data'
 , 'line vier data'
 , 'line fuenf [[ '
 , 'line sechs [[{'
 , 'line sieben [[{['
 , 'line acht [[{[]}] '
 , 'line neun out end'
;
test dFor comp 'd':
   'vor Loop $@for  var $$ loop<${var}>   '
 , 'nach loop'
;
compare:
   '--- --- test begin dFor comp d >>> 2 lines'
 , '--- compile data: 2 lines: vor Loop $@for  var $$ loop<${var}>   '
 , '--- run without input'
 , 'vor Loop '
 , '--- read 0<<endOfInput>>'
 , 'nach loop'
 , '--- run with 3 inputs'
 , 'vor Loop '
 , '--- read 0: eins zwei drei'
 , 'loop<eins zwei drei>'
 , '--- read 1: zehn elf zwölf?'
 , 'loop<zehn elf zwölf?>'
 , '--- read 2: zwanzig 21 22 23 24 ... 29 und Schluss !'
 , 'loop<zwanzig 21 22 23 24 ... 29 und Schluss !>'
 , '--- read 3<<endOfInput>>'
 , 'nach loop'
;
test dFor2 comp 'd':
   'vor Loop $@for  xyz $[loop line'
 , '$xyz in one line$]nach loop'
;
compare:
   '--- --- test begin dFor2 comp d >>> 2 lines'
 , '--- compile data: 2 lines: vor Loop $@for  xyz $[loop line'
 , '--- run without input'
 , 'vor Loop '
 , '--- read 0<<endOfInput>>'
 , 'nach loop'
 , '--- run with 3 inputs'
 , 'vor Loop '
 , '--- read 0: eins zwei drei'
 , 'loop line'
 , 'eins zwei drei in one line'
 , '--- read 1: zehn elf zwölf?'
 , 'loop line'
 , 'zehn elf zwölf? in one line'
 , '--- read 2: zwanzig 21 22 23 24 ... 29 und Schluss !'
 , 'loop line'
 , 'zwanzig 21 22 23 24 ... 29 und Schluss ! in one line'
 , '--- read 3<<endOfInput>>'
 , 'nach loop'
;
test sForColl comp 's':
   'java.util.ArrayList<Integer> al = new java.util.ArrayList<Integer>(); Ut.addAll(al,2,3,5,7); $$ vor Loop $; $<£$(al$) $@for  var : Integer $£ "loop " + $var + " " + $var.getClass()$;'
 , '$$nach loop'
;
compare:
   '--- --- test begin sForColl comp s >>> 2 lines'
 , '--- compile coSh: 2 lines: java.util.ArrayList<Integer> al = new java.util.ArrayList<Integer>(); Ut.addAll(al,2,3,5,7); $$ vor Loop $; $<£$(al$) $@for  var : Integer $£ "loop " + $var + " " + $var.getClass()$;'
 , '--- run without input'
 , 'vor Loop'
 , 'loop 2 class java.lang.Integer'
 , 'loop 3 class java.lang.Integer'
 , 'loop 5 class java.lang.Integer'
 , 'loop 7 class java.lang.Integer'
 , 'nach loop'
 , '--- run with 3 inputs'
 , 'vor Loop'
 , 'loop 2 class java.lang.Integer'
 , 'loop 3 class java.lang.Integer'
 , 'loop 5 class java.lang.Integer'
 , 'loop 7 class java.lang.Integer'
 , 'nach loop'
;
writeTestFiles = removeTestFiles(
 );
remove writeTestFiles;
writeTestFiles = writeTestFiles(
   'eins\elf.tst1'
 , 'eins\zwoelf.tst1'
 , 'zwei/zwanz/f201'
 , 'zwei/zwanz/f202'
 );
writeTestFiles = removeTestFiles(
 );
remove writeTestFiles;