refactor objects
Some checks failed
Publish Image / publish (push) Waiting to run
Test / build (push) Waiting to run
Build / build (push) Has been cancelled

This commit is contained in:
2024-04-01 17:34:10 -04:00
parent 803f330e82
commit 99f7553d67
15 changed files with 101 additions and 94 deletions

View File

@@ -379,15 +379,15 @@ func TestHashLiterals(t *testing.T) {
{
"{1: 2, 2: 3}",
map[object.HashKey]int64{
(object.Integer{Value: 1}).HashKey(): 2,
(object.Integer{Value: 2}).HashKey(): 3,
(object.Integer{Value: 1}).Hash(): 2,
(object.Integer{Value: 2}).Hash(): 3,
},
},
{
"{1 + 1: 2 * 2, 3 + 3: 4 * 4}",
map[object.HashKey]int64{
(object.Integer{Value: 2}).HashKey(): 4,
(object.Integer{Value: 6}).HashKey(): 16,
(object.Integer{Value: 2}).Hash(): 4,
(object.Integer{Value: 6}).Hash(): 16,
},
},
}
@@ -400,14 +400,14 @@ func TestHashMerging(t *testing.T) {
{
`{} + {"a": 1}`,
map[object.HashKey]int64{
(object.String{Value: "a"}).HashKey(): 1,
(object.String{Value: "a"}).Hash(): 1,
},
},
{
`{"a": 1} + {"b": 2}`,
map[object.HashKey]int64{
(object.String{Value: "a"}).HashKey(): 1,
(object.String{Value: "b"}).HashKey(): 2,
(object.String{Value: "a"}).Hash(): 1,
(object.String{Value: "b"}).Hash(): 2,
},
},
}