11//! Comparison operator tests (< > <= >=)
22//!
3- //! Converted from src/operators/<_test.sql, >_test.sql, <=_test.sql, >=_test.sql
43//! Tests EQL comparison operators with ORE (Order-Revealing Encryption)
54
65use anyhow:: { Context , Result } ;
@@ -47,7 +46,6 @@ async fn create_encrypted_json_with_index(
4746async fn less_than_operator_with_ore ( pool : PgPool ) -> Result < ( ) > {
4847 // Test: e < e with ORE encryption
4948 // Value 42 should have 41 records less than it (1-41)
50- // Original SQL lines 13-20 in src/operators/<_test.sql
5149 // Uses ore table from migrations/002_install_ore_data.sql (ids 1-99)
5250
5351 // Get encrypted value for id=42 from pre-seeded ore table
@@ -67,7 +65,6 @@ async fn less_than_operator_with_ore(pool: PgPool) -> Result<()> {
6765#[ sqlx:: test]
6866async fn lt_function_with_ore ( pool : PgPool ) -> Result < ( ) > {
6967 // Test: eql_v2.lt() function with ORE
70- // Original SQL lines 30-37 in src/operators/<_test.sql
7168
7269 let ore_term = get_ore_encrypted ( & pool, 42 ) . await ?;
7370
@@ -120,7 +117,6 @@ async fn less_than_operator_jsonb_less_than_encrypted(pool: PgPool) -> Result<()
120117async fn greater_than_operator_with_ore ( pool : PgPool ) -> Result < ( ) > {
121118 // Test: e > e with ORE encryption
122119 // Value 42 should have 57 records greater than it (43-99)
123- // Original SQL lines 13-20 in src/operators/>_test.sql
124120 // Uses ore table from migrations/002_install_ore_data.sql (ids 1-99)
125121
126122 let ore_term = get_ore_encrypted ( & pool, 42 ) . await ?;
@@ -138,7 +134,6 @@ async fn greater_than_operator_with_ore(pool: PgPool) -> Result<()> {
138134#[ sqlx:: test]
139135async fn gt_function_with_ore ( pool : PgPool ) -> Result < ( ) > {
140136 // Test: eql_v2.gt() function with ORE
141- // Original SQL lines 30-37 in src/operators/>_test.sql
142137
143138 let ore_term = get_ore_encrypted ( & pool, 42 ) . await ?;
144139
@@ -190,7 +185,6 @@ async fn greater_than_operator_jsonb_greater_than_encrypted(pool: PgPool) -> Res
190185async fn less_than_or_equal_operator_with_ore ( pool : PgPool ) -> Result < ( ) > {
191186 // Test: e <= e with ORE encryption
192187 // Value 42 should have 42 records <= it (1-42 inclusive)
193- // Original SQL lines 10-24 in src/operators/<=_test.sql
194188 // Uses ore table from migrations/002_install_ore_data.sql (ids 1-99)
195189
196190 let ore_term = get_ore_encrypted ( & pool, 42 ) . await ?;
@@ -209,7 +203,6 @@ async fn less_than_or_equal_operator_with_ore(pool: PgPool) -> Result<()> {
209203#[ sqlx:: test]
210204async fn lte_function_with_ore ( pool : PgPool ) -> Result < ( ) > {
211205 // Test: eql_v2.lte() function with ORE
212- // Original SQL lines 32-46 in src/operators/<=_test.sql
213206
214207 let ore_term = get_ore_encrypted ( & pool, 42 ) . await ?;
215208
@@ -226,7 +219,6 @@ async fn lte_function_with_ore(pool: PgPool) -> Result<()> {
226219#[ sqlx:: test]
227220async fn less_than_or_equal_with_jsonb ( pool : PgPool ) -> Result < ( ) > {
228221 // Test: e <= jsonb with ORE
229- // Original SQL lines 55-69 in src/operators/<=_test.sql
230222
231223 let json_value = get_ore_encrypted_as_jsonb ( & pool, 42 ) . await ?;
232224
@@ -260,7 +252,6 @@ async fn less_than_or_equal_jsonb_lte_encrypted(pool: PgPool) -> Result<()> {
260252async fn greater_than_or_equal_operator_with_ore ( pool : PgPool ) -> Result < ( ) > {
261253 // Test: e >= e with ORE encryption
262254 // Value 42 should have 58 records >= it (42-99 inclusive)
263- // Original SQL lines 10-24 in src/operators/>=_test.sql
264255 // Uses ore table from migrations/002_install_ore_data.sql (ids 1-99)
265256
266257 let ore_term = get_ore_encrypted ( & pool, 42 ) . await ?;
@@ -278,7 +269,6 @@ async fn greater_than_or_equal_operator_with_ore(pool: PgPool) -> Result<()> {
278269#[ sqlx:: test]
279270async fn gte_function_with_ore ( pool : PgPool ) -> Result < ( ) > {
280271 // Test: eql_v2.gte() function with ORE
281- // Original SQL lines 32-46 in src/operators/>=_test.sql
282272
283273 let ore_term = get_ore_encrypted ( & pool, 42 ) . await ?;
284274
@@ -295,7 +285,6 @@ async fn gte_function_with_ore(pool: PgPool) -> Result<()> {
295285#[ sqlx:: test]
296286async fn greater_than_or_equal_with_jsonb ( pool : PgPool ) -> Result < ( ) > {
297287 // Test: e >= jsonb with ORE
298- // Original SQL lines 55-85 in src/operators/>=_test.sql
299288
300289 let json_value = get_ore_encrypted_as_jsonb ( & pool, 42 ) . await ?;
301290
@@ -309,7 +298,6 @@ async fn greater_than_or_equal_with_jsonb(pool: PgPool) -> Result<()> {
309298#[ sqlx:: test]
310299async fn greater_than_or_equal_jsonb_gte_encrypted ( pool : PgPool ) -> Result < ( ) > {
311300 // Test: jsonb >= e with ORE (reverse direction)
312- // Original SQL lines 77-80 in src/operators/>=_test.sql
313301
314302 let json_value = get_ore_encrypted_as_jsonb ( & pool, 42 ) . await ?;
315303
0 commit comments