Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
20 lines (15 sloc) 545 Bytes
package stm
import (
"reflect"
"testing"
)
func TestMergeMap(t *testing.T) {
var src, dst, expect [][]interface{}
src = [][]interface{}{{"loc", "1"}, {"changefreq", "2"}, {"mobile", true}, {"host", "http://google.com"}}
dst = [][]interface{}{{"host", "http://example.com"}}
expect = [][]interface{}{{"loc", "1"}, {"changefreq", "2"}, {"mobile", true}, {"host", "http://google.com"}}
src = MergeMap(src, dst)
if !reflect.DeepEqual(src, expect) {
t.Fatalf("Failed to maps merge: deferrent map \n%#v\n and \n%#v\n", src, expect)
}
}
You can’t perform that action at this time.