Parcourir la source

Add a test for range statement recognition with public Scalar expressions for the range endpoints

Ian Goldberg il y a 6 mois
Parent
commit
45a262b32c
1 fichiers modifiés avec 16 ajouts et 0 suppressions
  1. 16 0
      sigma_compiler_core/src/rangeproof.rs

+ 16 - 0
sigma_compiler_core/src/rangeproof.rs

@@ -356,5 +356,21 @@ mod tests {
                 },
             }),
         );
+
+        parse_tester(
+            vars,
+            parse_quote! {
+                (a*b..b+c*c+7).contains(3*x+c*(a+b+2))
+            },
+            Some(RangeStatement {
+                upper: parse_quote! { b+c*c+7-(a*b) },
+                expr: LinScalar {
+                    coeff: 3,
+                    pub_scalar_expr: Some(parse_quote! { c*(a+b+2i128)-(a*b) }),
+                    id: parse_quote! {x},
+                    is_vec: false,
+                },
+            }),
+        );
     }
 }