Skip to content

Commit

Permalink
Fix broken maps test.
Browse files Browse the repository at this point in the history
  • Loading branch information
knadh committed Apr 3, 2024
1 parent 736ad3a commit 6b3f67c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/maps_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ var testMap3 = map[string]interface{}{
}

func TestFlatten(t *testing.T) {
f, k := maps.Flatten(testMap, nil, delim)
f, k := maps.Flatten(testMap, nil, ".")
assert.Equal(t, map[string]interface{}{
"parent.child.key": 123,
"parent.child.key.with.dot": 456,
Expand All @@ -118,17 +118,17 @@ func TestFlatten(t *testing.T) {

func BenchmarkFlatten(b *testing.B) {
for n := 0; n < b.N; n++ {
maps.Flatten(testMap3, nil, delim)
maps.Flatten(testMap3, nil, ".")
}
}

func TestUnflatten(t *testing.T) {
m, _ := maps.Flatten(testMap, nil, delim)
um := maps.Unflatten(m, delim)
m, _ := maps.Flatten(testMap, nil, ".")
um := maps.Unflatten(m, ".")
assert.NotEqual(t, um, testMap)

m, _ = maps.Flatten(testMap2, nil, delim)
um = maps.Unflatten(m, delim)
m, _ = maps.Flatten(testMap2, nil, ".")
um = maps.Unflatten(m, ".")
assert.Equal(t, um, testMap2)
}

Expand Down

0 comments on commit 6b3f67c

Please sign in to comment.