File tree Expand file tree Collapse file tree 1 file changed +27
-1
lines changed
Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ func TestRemoveByBasic(t *testing.T) {
8181
8282 // After removal, only 2 rows should remain non-nil
8383 count := 0
84- for _ , r := range b .getBy (make (map [int ]string )) {
84+ for _ , r := range b .all (make (map [int ]string )) {
8585 if r != nil {
8686 count ++ // non-nil rows
8787 if r [1 ] == "remove" {
@@ -92,6 +92,32 @@ func TestRemoveByBasic(t *testing.T) {
9292 if count != 2 {
9393 t .Errorf ("expected 2 remaining rows, got %d" , count )
9494 }
95+ // After removal, only 2 rows should remain non-nil
96+ count = 0
97+ for _ , r := range b .getBy (make (map [int ]string )) {
98+ if r != nil {
99+ count ++ // non-nil rows
100+ if r [1 ] == "remove" {
101+ t .Errorf ("found removed row %v" , r )
102+ }
103+ }
104+ }
105+ if count != 0 {
106+ t .Errorf ("expected no remaining rows when querying empty map, got %d" , count )
107+ }
108+ // After removal, only 2 rows should remain non-nil
109+ count = 0
110+ for _ , r := range b .getBy (nil ) {
111+ if r != nil {
112+ count ++ // non-nil rows
113+ if r [1 ] == "remove" {
114+ t .Errorf ("found removed row %v" , r )
115+ }
116+ }
117+ }
118+ if count != 0 {
119+ t .Errorf ("expected no remaining rows when querying nil, got %d" , count )
120+ }
95121}
96122
97123func TestRemoveBy_MultiClause (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments