// Test removing one set of SeriesIDs from another. func Test_SeriesIDs_Reject(t *testing.T) { // Test all branches of if-else, exit loop because of 'j < len(r)', and append remainder from left. ids1 := tsdb.SeriesIDs{1, 2, 3, 7} ids2 := tsdb.SeriesIDs{1, 3, 4, 5, 6} exp := tsdb.SeriesIDs{2, 7} got := ids1.Reject(ids2) if !exp.Equals(got) { t.Fatalf("exp=%v, got=%v", exp, got) } // Test exit because of 'i < len(l)'. ids1 = tsdb.SeriesIDs{1} ids2 = tsdb.SeriesIDs{1, 2} exp = tsdb.SeriesIDs{} got = ids1.Reject(ids2) if !exp.Equals(got) { t.Fatalf("exp=%v, got=%v", exp, got) } }