mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-07 19:37:51 +00:00
added test case
This commit is contained in:
parent
060c73fb2f
commit
716a3a89c1
1 changed files with 19 additions and 0 deletions
|
|
@ -168,3 +168,22 @@ func TestEncodeDecodeDistinctTimestamp(t *testing.T) {
|
|||
t.Errorf("failed to encode DistinctTimestamp. expected %v got %v", &pbTime, encoded)
|
||||
}
|
||||
}
|
||||
|
||||
func TestDecodeQueryResult(t *testing.T) {
|
||||
t.Run("DistinctTimestamp", func(t *testing.T) {
|
||||
pbTime := pb.DistinctTimestamp{
|
||||
Values: []string{"this", "is", "fake", "timestamp", "values"},
|
||||
Name: "pbtime",
|
||||
}
|
||||
piloTime := pilosa.DistinctTimestamp{
|
||||
Values: []string{"this", "is", "fake", "timestamp", "values"},
|
||||
Name: "pbtime",
|
||||
}
|
||||
q := &pb.QueryResult{Type: queryResultTypeDistinctTimestamp, DistinctTimestamp: &pbTime}
|
||||
s := Serializer{}
|
||||
decoded := s.decodeQueryResult(q)
|
||||
if !reflect.DeepEqual(decoded, piloTime) {
|
||||
t.Errorf("failed to decode DistinctTimestamp. expected %v got %v", piloTime, decoded)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue