Commit e5ab9deeb024b6c748dc0a985b52b0dab3c53594

Thomas de Grivel 2024-08-13T17:47:12

fix tests for access

diff --git a/test/ikc3/access.kc3 b/test/ikc3/access.kc3
index 931fa06..4599959 100644
--- a/test/ikc3/access.kc3
+++ b/test/ikc3/access.kc3
@@ -1,68 +1,44 @@
-quote %{a: 1, b: 2, c: 3}.a
-%{a: 1, b: 2, c: 3}.a
-quote %{"a" => 1, "b" => 2, "c" => 3}["a"]
-%{"a" => 1, "b" => 2, "c" => 3}["a"]
-quote %{a: 1, b: 2, c: 3}[:a]
-%{a: 1, b: 2, c: 3}[:a]
-quote %{a: 1, b: 2, c: 3}.b
-%{a: 1, b: 2, c: 3}.b
-quote %{a: 1, b: 2, c: 3}[:b]
-%{a: 1, b: 2, c: 3}[:b]
-quote %{"a" => 1, "b" => 2, "c" => 3}["b"]
-%{"a" => 1, "b" => 2, "c" => 3}["b"]
-quote %{a: 1, b: 2, c: 3}.c
-%{a: 1, b: 2, c: 3}.c
-quote %{a: 1, b: 2, c: 3}[:c]
-%{a: 1, b: 2, c: 3}[:c]
-quote %{"a" => 1, "b" => 2, "c" => 3}["c"]
-%{"a" => 1, "b" => 2, "c" => 3}["c"]
-quote %{a: %{b: %{c: 1}}}.a
-%{a: %{b: %{c: 1}}}.a
-quote %{a: %{b: %{c: 1}}}[:a]
-%{a: %{b: %{c: 1}}}[:a]
-quote %{"a" => %{"b" => %{"c" => 3}}}["a"]
-%{"a" => %{"b" => %{"c" => 3}}}["a"]
-quote %{a: %{b: %{c: 1}}}.a.b
-%{a: %{b: %{c: 1}}}.a.b
-quote %{a: %{b: %{c: 1}}}[:a][:b]
-%{a: %{b: %{c: 1}}}[:a][:b]
-quote %{"a" => %{"b" => %{"c" => 3}}}["a"]["b"]
-%{"a" => %{"b" => %{"c" => 3}}}["a"]["b"]
-quote %{a: %{b: %{c: 1}}}.a.b.c
-%{a: %{b: %{c: 1}}}.a.b.c
-quote %{a: %{b: %{c: 1}}}[:a][:b][:c]
-%{a: %{b: %{c: 1}}}[:a][:b][:c]
-quote %{"a" => %{"b" => %{"c" => 3}}}["a"]["b"]["c"]
-%{"a" => %{"b" => %{"c" => 3}}}["a"]["b"]["c"]
+quote map = %{a: 1, b: 2, c: 3}
+map = %{a: 1, b: 2, c: 3}
+quote map.a
+map.a
+quote map.b
+map.b
+quote map.c
+map.c
+quote map = %{"a" => 1, "b" => 2, "c" => 3}
+map = %{"a" => 1, "b" => 2, "c" => 3}
+quote map["a"]
+map["a"]
+quote map["b"]
+map["b"]
+quote map["c"]
+map["c"]
 quote map = %{a: %{b: %{c: 1}}}
 map = %{a: %{b: %{c: 1}}}
-quote map
-map
 quote map.a
 map.a
 quote map.a.b
 map.a.b
+quote map[:a][:b]
+map[:a][:b]
 quote map.a.b.c
 map.a.b.c
-quote map.a.b.c + map.a.b.c
-map.a.b.c + map.a.b.c
 quote "0 #{map.a.b.c} 2"
 "0 #{map.a.b.c} 2"
-quote map = %{"a" => %{"b" => %{"c" => 1}}}
-map = %{"a" => %{"b" => %{"c" => 1}}}
-quote map
-map
+quote map[:a][:b][:c]
+map[:a][:b][:c]
+quote map = %{"a" => %{"b" => %{"c" => 3}}}
+map = %{"a" => %{"b" => %{"c" => 3}}}
 quote map["a"]
 map["a"]
 quote map["a"]["b"]
 map["a"]["b"]
 quote map["a"]["b"]["c"]
 map["a"]["b"]["c"]
-quote map["a"]["b"]["c"] + map["a"]["b"]["c"]
-map["a"]["b"]["c"] + map["a"]["b"]["c"]
-quote """0 #{map["a"]["b"]["c"]} 2"""
-"""0 #{map["a"]["b"]["c"]} 2"""
 quote op = %KC3.Operator{}
 op = %KC3.Operator{}
 quote op.sym
 op.sym
+quote op[:sym]
+op[:sym]
diff --git a/test/ikc3/access.out.expected b/test/ikc3/access.out.expected
index c2970eb..4359092 100644
--- a/test/ikc3/access.out.expected
+++ b/test/ikc3/access.out.expected
@@ -1,85 +1,49 @@
+map = %{a: 1,
+        b: 2,
+        c: 3}
 %{a: 1,
   b: 2,
-  c: 3}.a
-1
-%{"a" => 1,
-  "b" => 2,
-  "c" => 3}["a"]
-1
-%{a: 1,
-  b: 2,
-  c: 3}[:a]
+  c: 3}
+map.a
 1
-%{a: 1,
-  b: 2,
-  c: 3}.b
+map.b
 2
-%{a: 1,
-  b: 2,
-  c: 3}[:b]
-2
-%{"a" => 1,
-  "b" => 2,
-  "c" => 3}["b"]
-2
-%{a: 1,
-  b: 2,
-  c: 3}.c
-3
-%{a: 1,
-  b: 2,
-  c: 3}[:c]
+map.c
 3
+map = %{"a" => 1,
+        "b" => 2,
+        "c" => 3}
 %{"a" => 1,
   "b" => 2,
-  "c" => 3}["c"]
-3
-%{a: %{b: %{c: 1}}}.a
-%{b: %{c: 1}}
-%{a: %{b: %{c: 1}}}[:a]
-%{b: %{c: 1}}
-%{"a" => %{"b" => %{"c" => 3}}}["a"]
-%{"b" => %{"c" => 3}}
-%{a: %{b: %{c: 1}}}.a.b
-%{c: 1}
-%{a: %{b: %{c: 1}}}[:a][:b]
-%{c: 1}
-%{"a" => %{"b" => %{"c" => 3}}}["a"]["b"]
-%{"c" => 3}
-%{a: %{b: %{c: 1}}}.a.b.c
-1
-%{a: %{b: %{c: 1}}}[:a][:b][:c]
+  "c" => 3}
+map["a"]
 1
-%{"a" => %{"b" => %{"c" => 3}}}["a"]["b"]["c"]
+map["b"]
+2
+map["c"]
 3
 map = %{a: %{b: %{c: 1}}}
 %{a: %{b: %{c: 1}}}
-map
-%{a: %{b: %{c: 1}}}
 map.a
 %{b: %{c: 1}}
 map.a.b
 %{c: 1}
+map[:a][:b]
+%{c: 1}
 map.a.b.c
 1
-map.a.b.c + map.a.b.c
-2
 "0 #{map.a.b.c} 2"
 "0 1 2"
-map = %{"a" => %{"b" => %{"c" => 1}}}
-%{"a" => %{"b" => %{"c" => 1}}}
-map
-%{"a" => %{"b" => %{"c" => 1}}}
+map[:a][:b][:c]
+1
+map = %{"a" => %{"b" => %{"c" => 3}}}
+%{"a" => %{"b" => %{"c" => 3}}}
 map["a"]
-%{"b" => %{"c" => 1}}
+%{"b" => %{"c" => 3}}
 map["a"]["b"]
-%{"c" => 1}
+%{"c" => 3}
 map["a"]["b"]["c"]
-1
-map["a"]["b"]["c"] + map["a"]["b"]["c"]
-2
-"0 #{map["a"]["b"]["c"]} 2"
-"0 1 2"
+3
 op = %KC3.Operator{}
 %KC3.Operator{sym: :+,
               symbol_value: ?,
@@ -87,3 +51,5 @@ op = %KC3.Operator{}
               operator_associativity: :left}
 op.sym
 :+
+op[:sym]
+:+