From 7724bb0604766f22524200e92a89fa8449d7c977 Mon Sep 17 00:00:00 2001 From: Reuben Thomas Date: Thu, 22 Aug 2024 00:28:52 +0100 Subject: [PATCH] Add simple tests for object, list and map equality --- src/ursa/basics.test.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ursa/basics.test.ts b/src/ursa/basics.test.ts index de59e84..7b65876 100644 --- a/src/ursa/basics.test.ts +++ b/src/ursa/basics.test.ts @@ -157,10 +157,12 @@ testGroup('Lists', [ ['[1, 2].push(3).len()', 3], ['[1, 2, 3].get(1)', 2], ['let l = [1, 2, 3]; l.set(1, 4); l', [1, 4, 3]], + ['let x = []; x == x', true], ]) testGroup('Objects', [ ['Object {;}', {}], + ['let x = {;}; x == x', true], ['ABC {a = 1; b = 2; c=3}', {a: 1, b: 2, c: 3}], ['let o = ABC {a = 1; b = 2}; o.b := 3; o', {a: 1, b: 3}], ]) @@ -180,6 +182,7 @@ Invalid property`) testGroup('Maps', [ ['{}', new Map()], + ['let x = {}; x == x', true], ['{"a": 1, "b": 2 + 0, 3: 4}', new Map([['a', 1], ['b', 2], [3, 4]])], ['let t = {"a": 1, "b": 2 + 0, 3: 4}; t.set("b", 1); t', new Map([['a', 1], ['b', 1], [3, 4]])], ])