mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2026-05-17 00:26:36 +03:00
fix search test
Signed-off-by: Artem Fetishev <rtm@victoriametrics.com>
This commit is contained in:
@@ -32,7 +32,12 @@ func TestSearchQueryMarshalUnmarshal(t *testing.T) {
|
||||
// Skip nil sq1.
|
||||
continue
|
||||
}
|
||||
buf = sq1.Marshal(buf[:0])
|
||||
tt := TenantToken{
|
||||
AccountID: sq1.AccountID,
|
||||
ProjectID: sq1.ProjectID,
|
||||
}
|
||||
buf = tt.Marshal(buf[:0])
|
||||
buf = sq1.MarshalWithoutTenant(buf)
|
||||
|
||||
tail, err := sq2.Unmarshal(buf)
|
||||
if err != nil {
|
||||
@@ -41,6 +46,12 @@ func TestSearchQueryMarshalUnmarshal(t *testing.T) {
|
||||
if len(tail) > 0 {
|
||||
t.Fatalf("unexpected tail left after SearchQuery unmarshaling; tail (len=%d): %q", len(tail), tail)
|
||||
}
|
||||
if sq2.AccountID != sq1.AccountID {
|
||||
t.Fatalf("unexpected AccountID; got %d; want %d", sq2.AccountID, sq1.AccountID)
|
||||
}
|
||||
if sq2.ProjectID != sq1.ProjectID {
|
||||
t.Fatalf("unexpected ProjectID; got %d; want %d", sq2.ProjectID, sq1.ProjectID)
|
||||
}
|
||||
if sq1.MinTimestamp != sq2.MinTimestamp {
|
||||
t.Fatalf("unexpected MinTimestamp; got %d; want %d", sq2.MinTimestamp, sq1.MinTimestamp)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user