...
1 package mergo_test
2
3 import (
4 "testing"
5
6 "dario.cat/mergo"
7 )
8
9 func TestIssue209(t *testing.T) {
10 dst := []string{"a", "b"}
11 src := []string{"c", "d"}
12
13 if err := mergo.Merge(&dst, src, mergo.WithAppendSlice); err != nil {
14 t.Error(err)
15 }
16
17 expected := []string{"a", "b", "c", "d"}
18 if len(dst) != len(expected) {
19 t.Errorf("arrays not equal length")
20 }
21 for i := range expected {
22 if dst[i] != expected[i] {
23 t.Errorf("array elements at %d are not equal", i)
24 }
25 }
26 }
27
View as plain text