Skip to content

Commit bac3c8b

Browse files
committed
fix unit test
1 parent 8cbd777 commit bac3c8b

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

libs/dyn/merge/elements_by_key_test.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ import (
1111

1212
func TestElementByKey(t *testing.T) {
1313
vin := dyn.V([]dyn.Value{
14-
dyn.V(map[string]dyn.Value{
15-
"key": dyn.V("foo"),
16-
"value": dyn.V(42),
17-
}),
1814
dyn.V(map[string]dyn.Value{
1915
"key": dyn.V("bar"),
2016
"value": dyn.V(43),
2117
}),
18+
dyn.V(map[string]dyn.Value{
19+
"key": dyn.V("foo"),
20+
"value": dyn.V(42),
21+
}),
2222
dyn.V(map[string]dyn.Value{
2323
// Use upper case key to test that the resulting element has its
2424
// key field assigned to the output of the key function.
@@ -36,14 +36,14 @@ func TestElementByKey(t *testing.T) {
3636
require.NoError(t, err)
3737
assert.Len(t, vout.MustSequence(), 2)
3838
assert.Equal(t,
39-
vout.Index(0).AsAny(),
39+
vout.Index(1).AsAny(),
4040
map[string]any{
4141
"key": "foo",
4242
"value": 44,
4343
},
4444
)
4545
assert.Equal(t,
46-
vout.Index(1).AsAny(),
46+
vout.Index(0).AsAny(),
4747
map[string]any{
4848
"key": "bar",
4949
"value": 43,
@@ -53,14 +53,14 @@ func TestElementByKey(t *testing.T) {
5353

5454
func TestElementByKeyWithOverride(t *testing.T) {
5555
vin := dyn.V([]dyn.Value{
56-
dyn.V(map[string]dyn.Value{
57-
"key": dyn.V("foo"),
58-
"value": dyn.V(42),
59-
}),
6056
dyn.V(map[string]dyn.Value{
6157
"key": dyn.V("bar"),
6258
"value": dyn.V(43),
6359
}),
60+
dyn.V(map[string]dyn.Value{
61+
"key": dyn.V("foo"),
62+
"value": dyn.V(42),
63+
}),
6464
dyn.V(map[string]dyn.Value{
6565
"key": dyn.V("foo"),
6666
"othervalue": dyn.V(44),
@@ -75,14 +75,14 @@ func TestElementByKeyWithOverride(t *testing.T) {
7575
require.NoError(t, err)
7676
assert.Len(t, vout.MustSequence(), 2)
7777
assert.Equal(t,
78-
vout.Index(0).AsAny(),
78+
vout.Index(1).AsAny(),
7979
map[string]any{
8080
"key": "foo",
8181
"othervalue": 44,
8282
},
8383
)
8484
assert.Equal(t,
85-
vout.Index(1).AsAny(),
85+
vout.Index(0).AsAny(),
8686
map[string]any{
8787
"key": "bar",
8888
"value": 43,

0 commit comments

Comments
 (0)