0
0
Fork 0

cover another case in the merge

This commit is contained in:
Marty Schoch 2014-04-25 09:44:07 -06:00
parent 4affede801
commit 267811a6d2
1 changed files with 22 additions and 1 deletions

View File

@ -38,6 +38,18 @@ func TestMergeLocations(t *testing.T) {
},
}
flm3 := FieldTermLocationMap{
"josh": TermLocationMap{
"description": {
&Location{
Pos: 5,
Start: 20,
End: 25,
},
},
},
}
expectedMerge := FieldTermLocationMap{
"marty": TermLocationMap{
"description": {
@ -55,9 +67,18 @@ func TestMergeLocations(t *testing.T) {
},
},
},
"josh": TermLocationMap{
"description": {
&Location{
Pos: 5,
Start: 20,
End: 25,
},
},
},
}
mergedLocations := mergeLocations([]FieldTermLocationMap{flm1, flm2})
mergedLocations := mergeLocations([]FieldTermLocationMap{flm1, flm2, flm3})
if !reflect.DeepEqual(expectedMerge, mergedLocations) {
t.Errorf("expected %v, got %v", expectedMerge, mergedLocations)
}