github.com/TeaOSLab/EdgeNode@v1.3.8/internal/utils/jsonutils/utils_test.go (about) 1 // Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn . 2 3 package jsonutils_test 4 5 import ( 6 "github.com/TeaOSLab/EdgeNode/internal/utils/jsonutils" 7 "github.com/iwind/TeaGo/assert" 8 "github.com/iwind/TeaGo/maps" 9 "testing" 10 ) 11 12 func TestEqual(t *testing.T) { 13 var a = assert.NewAssertion(t) 14 15 { 16 var m1 = maps.Map{"a": 1, "b2": true} 17 var m2 = maps.Map{"b2": true, "a": 1} 18 a.IsTrue(jsonutils.Equal(m1, m2)) 19 } 20 21 { 22 var m1 = maps.Map{"a": 1, "b2": true, "c": nil} 23 var m2 = maps.Map{"b2": true, "a": 1} 24 a.IsFalse(jsonutils.Equal(m1, m2)) 25 } 26 }