@@ -47,11 +47,15 @@ func testQueryConditionInt32(t *testing.T, array *Array) {
4747 name string
4848 opValue int32
4949 op QueryConditionOp
50+ negate bool
5051 expectedValues []int32
5152 }{
52- {"GreaterThan1" , 1 , TILEDB_QUERY_CONDITION_GT , []int32 {2 , 3 }},
53- {"LessThan3" , 3 , TILEDB_QUERY_CONDITION_LT , []int32 {1 , 2 }},
54- {"EqualTo2" , 2 , TILEDB_QUERY_CONDITION_EQ , []int32 {2 }},
53+ {"GreaterThan1" , 1 , TILEDB_QUERY_CONDITION_GT , false , []int32 {2 , 3 }},
54+ {"NotGreaterThan1" , 1 , TILEDB_QUERY_CONDITION_GT , true , []int32 {1 }},
55+ {"LessThan3" , 3 , TILEDB_QUERY_CONDITION_LT , false , []int32 {1 , 2 }},
56+ {"NotLessThan3" , 3 , TILEDB_QUERY_CONDITION_LT , true , []int32 {3 }},
57+ {"EqualTo2" , 2 , TILEDB_QUERY_CONDITION_EQ , false , []int32 {2 }},
58+ {"NotEqualTo2" , 2 , TILEDB_QUERY_CONDITION_EQ , true , []int32 {1 , 3 }},
5559 }
5660 for _ , c := range a1Cases {
5761 c := c
@@ -69,6 +73,11 @@ func testQueryConditionInt32(t *testing.T, array *Array) {
6973 qc , err := NewQueryCondition (array .context , "a1" , c .op , c .opValue )
7074 require .NoError (t , err )
7175
76+ if c .negate {
77+ qc , err = NewQueryConditionNegated (array .context , qc )
78+ require .NoError (t , err )
79+ }
80+
7281 err = query .SetQueryCondition (qc )
7382 require .NoError (t , err )
7483
@@ -96,6 +105,7 @@ func testQueryConditionInt32(t *testing.T, array *Array) {
96105 op2 QueryConditionOp
97106 op2Value int32
98107 combinationCondition QueryConditionCombinationOp
108+ negate bool
99109 expectedValues []int32
100110 }{
101111 {
@@ -105,8 +115,19 @@ func testQueryConditionInt32(t *testing.T, array *Array) {
105115 op2 : TILEDB_QUERY_CONDITION_LT ,
106116 op2Value : 3 ,
107117 combinationCondition : TILEDB_QUERY_CONDITION_AND ,
118+ negate : false ,
108119 expectedValues : []int32 {2 },
109120 },
121+ {
122+ name : "NotGreaterThan1AndLessThan3" ,
123+ op1 : TILEDB_QUERY_CONDITION_GT ,
124+ op1Value : 1 ,
125+ op2 : TILEDB_QUERY_CONDITION_LT ,
126+ op2Value : 3 ,
127+ combinationCondition : TILEDB_QUERY_CONDITION_AND ,
128+ negate : true ,
129+ expectedValues : []int32 {1 , 3 },
130+ },
110131 }
111132 for _ , c := range a1CombinationCases {
112133 c := c
@@ -130,6 +151,11 @@ func testQueryConditionInt32(t *testing.T, array *Array) {
130151 qc , err := NewQueryConditionCombination (array .context , qc1 , c .combinationCondition , qc2 )
131152 require .NoError (t , err )
132153
154+ if c .negate {
155+ qc , err = NewQueryConditionNegated (array .context , qc )
156+ require .NoError (t , err )
157+ }
158+
133159 err = query .SetQueryCondition (qc )
134160 require .NoError (t , err )
135161
0 commit comments