From 1f9147187d66e95a0ffedd4d5595ec98646b5fe1 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 25 Mar 2025 15:40:59 -0400 Subject: Make docstring tests use an actual expression AST instead of text matching --- test/tables.tm | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'test/tables.tm') diff --git a/test/tables.tm b/test/tables.tm index c97c35a0..9749835d 100644 --- a/test/tables.tm +++ b/test/tables.tm @@ -3,11 +3,11 @@ func main(): = {"one"=1, "two"=2} >> t["one"] - = 1 : Int? + = 1? >> t["two"] - = 2 : Int? + = 2? >> t["???"] - = none : Int? + = none:Int >> t["one"]! = 1 >> t["???"] or -1 @@ -22,7 +22,7 @@ func main(): >> t.length = 2 >> t.fallback - = none : {Text,Int}? + = none : {Text,Int} >> t.keys = ["one", "two"] @@ -33,16 +33,16 @@ func main(): = {"three"=3; fallback={"one"=1, "two"=2}} >> t2["one"] - = 1 : Int? + = 1? >> t2["three"] - = 3 : Int? + = 3? >> t2["???"] - = none : Int? + = none:Int >> t2.length = 1 >> t2.fallback - = {"one"=1, "two"=2} : {Text,Int}? + = {"one"=1, "two"=2}? t2_str := "" for k,v in t2: @@ -95,11 +95,11 @@ func main(): = no >> {1=1, 2=2} <> {2=2, 1=1} - = 0 + = Int32(0) >> [{:Int,Int}, {0=0}, {99=99}, {1=1, 2=2, 3=3}, {1=1, 99=99, 3=3}, {1=1, 2=-99, 3=3}, {1=1, 99=-99, 3=4}]:sorted() - = [{}, {0=0}, {1=1, 2=-99, 3=3}, {1=1, 2=2, 3=3}, {1=1, 99=99, 3=3}, {1=1, 99=-99, 3=4}, {99=99}] + = [{:Int,Int}, {0=0}, {1=1, 2=-99, 3=3}, {1=1, 2=2, 3=3}, {1=1, 99=99, 3=3}, {1=1, 99=-99, 3=4}, {99=99}] >> [{:Int}, {1}, {2}, {99}, {0, 3}, {1, 2}, {99}]:sorted() - = [{}, {0, 3}, {1}, {1, 2}, {2}, {99}, {99}] + = [{:Int}, {0, 3}, {1}, {1, 2}, {2}, {99}, {99}] -- cgit v1.2.3