summaryrefslogtreecommitdiff
path: root/tests/typ/compiler
diff options
context:
space:
mode:
authorLeedehai <18319900+Leedehai@users.noreply.github.com>2024-02-05 04:42:47 -0500
committerGitHub <noreply@github.com>2024-02-05 09:42:47 +0000
commit6a9866dc80fefd5cd32e1432c4e95d3a834c3886 (patch)
tree773f2fcb36f010dac68f6120ee02fd42e333538b /tests/typ/compiler
parent92aba81a91364eb49f3a613cd2db3b2163202434 (diff)
Update dictionary.insert() doc and tests (#3343)
Diffstat (limited to 'tests/typ/compiler')
-rw-r--r--tests/typ/compiler/dict.typ10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/typ/compiler/dict.typ b/tests/typ/compiler/dict.typ
index cba2b618..92cacdb3 100644
--- a/tests/typ/compiler/dict.typ
+++ b/tests/typ/compiler/dict.typ
@@ -41,6 +41,16 @@
#test((a: 1, b: 2).at("c", default: 3), 3)
---
+// Test insert.
+#{
+ let dict = (a: 1, b: 2)
+ dict.insert("b", 3)
+ test(dict, (a: 1, b: 3))
+ dict.insert("c", 5)
+ test(dict, (a: 1, b: 3, c: 5))
+}
+
+---
// Test remove with default value.
#{
let dict = (a: 1, b: 2)