X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=tests%2Fregression.tc;h=863f8d80957a1fa9bb22298a63db6065c8a393e6;hb=eee310fc34d114be6b366f1a94fe6fe49da8b99b;hp=93127334fa0109a75bba6fa0e636c033091ad049;hpb=7d6f753c5fa4cead60e970959cd03ab36fde7951;p=sbp.git diff --git a/tests/regression.tc b/tests/regression.tc index 9312733..863f8d8 100644 --- a/tests/regression.tc +++ b/tests/regression.tc @@ -1,24 +1,3 @@ -//testcase { -// input "x"; -// output "a:{x}"; -// -// s = a1:: a -// a = s1:: s -// a = ^"x" -//} -// -//testcase { -// input "x"; -// output "x"; -// output "s2:{s2:{s0 s0} x}"; -// output "s2:{s0 x}"; -// -// -// s = s2:: s s -// s = ^"x" -// s = s0:: () -//} - testcase { input "aaaaa"; s = A @@ -26,15 +5,6 @@ testcase { | "a" A &~ "a" s } -//testcase { -// input "a"; -// output "yes:{}"; -// s = A -// A = "a" s &~ "a" A -// | "a" A &~ "a" s -// | () -//} - testcase { input "ab c"; output "1:{{a b} {c}}"; @@ -91,7 +61,7 @@ testcase { x = ~[] s = xbx:: x* b x* b = abab:: [ab][ab] - &~ ( "aa" | "bb" ) + &~ ("aa"|"bb") } testcase { @@ -217,23 +187,6 @@ testcase { idl = [a-d] } -//testcase { -// input "a*b*c"; -// output "times:{stringify:{{a}} times:{stringify:{{b}} stringify:{{c}}}}"; -// w = " " -// l = id -// s = l "=" r => "assign" -// | r -// r = l -// | l "=" r => "assign" -// | r "+" r => "plus" -// | (r) "*" r => "times" -// | "(" r ")" -// | r r => "times" -// id = idl++ => "stringify" -// idl = [a-d] -//} - testcase { input "a+b*c"; output "plus:{stringify:{{a}} times:{stringify:{{b}} stringify:{{c}}}}"; @@ -319,8 +272,6 @@ keyword = "if" | "then" | "else" | "while" } - - testcase { input "abc "; @@ -390,22 +341,32 @@ testcase { x = [123] } +testcase { + input "aaaaaaaa"; + output ""; + s = As & AAs + As = () | As "a" + AAs = () | AAs "aa" +} -//testcase { -// input "ab"; -// -// s = a:"a" b:"b" -//} - - +// make sure follow restrictions are honored +// when a string matches the empty string testcase { - input "a c"; - s = first:: A WSA B? WSB C - A = "a" - B = "b" - C = "c" - WSA = WSA:: " "** - WSB = () -> ~" " - | WSB:: " "++ + input "xxx"; + s = x:: "x" A "x" C "x" + A = B + B = "y" + | () -> ~"x" + C = D -> ~"x" + D = () } +testcase { + input "axxxxxc"; + output "q:{a {x x x x x} c}"; + s = q:: A ws B? ws C + ws = [x]** + A = a:: "a" + B = b:: "b" + C = c:: "c" +}