refactor objects
This commit is contained in:
@@ -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,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user