fix(orderedmap): fix set bug (#252)

set : when the key is present, the value of the data map should be set,
not the value of the list

Co-authored-by: congziqi <congziqi@lixiang.com>
This commit is contained in:
77andcongziqi authored and GitHub committed 2024-10-12 14:05:13 +08:00
1 parent 213e2b4ead
commit cb08613ac3
2 files changed
+5 -1

No files matched your search

+4
View File
@@ -19,6 +19,10 @@ func TestOrderedMap_Set_Get(t *testing.T) {
assert.Equal(1, val)
assert.Equal(true, ok)
om.Set("a", 2)
val, _ = om.Get("a")
assert.Equal(2, val)
val, ok = om.Get("d")
assert.Equal(false, ok)
assert.Equal(0, val)