Skip to content

Commit 78be58b

Browse files
committed
RHINENG-21424: update test for null filter operator
1 parent 850532f commit 78be58b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

manager/controllers/filter_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ var testFilters = []string{
1414
"gt:13",
1515
"lt:12",
1616
"between:12,13",
17+
"null:",
1718
}
1819

1920
func dummyParser(v string) (interface{}, error) {
@@ -22,7 +23,7 @@ func dummyParser(v string) (interface{}, error) {
2223

2324
func TestFilterParse(t *testing.T) {
2425
operators := []string{
25-
"eq", "in", "gt", "lt", "between",
26+
"eq", "in", "gt", "lt", "between", "null",
2627
}
2728

2829
values := [][]string{
@@ -31,6 +32,7 @@ func TestFilterParse(t *testing.T) {
3132
{"13"},
3233
{"12"},
3334
{"12", "13"},
35+
{""},
3436
}
3537

3638
for i, f := range testFilters {
@@ -47,6 +49,7 @@ func TestFilterToSql(t *testing.T) {
4749
"test > ? ",
4850
"test < ? ",
4951
"test BETWEEN ? AND ? ",
52+
"test IS NULL ",
5053
}
5154

5255
for i, f := range testFilters {
@@ -66,6 +69,7 @@ func TestFilterToSqlAdvanced(t *testing.T) {
6669
"(NOT test) > ? ",
6770
"(NOT test) < ? ",
6871
"(NOT test) BETWEEN ? AND ? ",
72+
"(NOT test) IS NULL ",
6973
}
7074

7175
for i, f := range testFilters {

0 commit comments

Comments
 (0)