1package sheet23import "testing"45// A criterion's walk over a whole column reads its cells right the first6// time, when its buffer grows between chunks.7func TestCriteriaWalkGrowingBuffer(t *testing.T) {8 s := New()9 for i := range 12 {10 lv := "info"11 if i == 5 {12 lv = "error"13 }14 s.Set(Addr{Col: 1, Row: i}, lv)15 }16 s.Set(Addr{Col: 5}, `=COUNTIF(B:B,"error")`)17 s.Set(Addr{Col: 5, Row: 1}, `=MATCH("error",B:B,0)`)18 if got := s.Value(Addr{Col: 5}); got.Num != 1 {19 t.Errorf("COUNTIF = %v, want 1", got)20 }21 if got := s.Value(Addr{Col: 5, Row: 1}); got.Num != 6 {22 t.Errorf("MATCH = %v, want 6", got)23 }24}