Add test and make it pass

This commit is contained in:
kortschak 2014-08-12 10:13:39 +09:30
parent aad21b0585
commit 99d44e3228
2 changed files with 10 additions and 2 deletions

View file

@ -19,6 +19,7 @@ import (
"compress/bzip2"
"compress/gzip"
"io"
"reflect"
"strings"
"sync"
"testing"
@ -358,9 +359,16 @@ func TestQueries(t *testing.T) {
continue
}
// TODO(kortschak) Be more rigorous in this result validation.
if len(got) != len(test.expect) {
t.Errorf("Unexpected number of results, got:%d expect:%d on %s.", len(got), len(test.expect), test.message)
continue
}
if reflect.DeepEqual(got, test.expect) {
continue
}
t.Errorf("Unexpected results for %s:\n", test.message)
for i := range got {
t.Errorf("\n\tgot:%#v\n\texpect:%#v\n", got[i], test.expect[i])
}
}
}