diff options
| author | Nicholas Rodrigues Lordello <[email protected]> | 2024-07-25 21:07:06 +0200 |
|---|---|---|
| committer | Nicholas Rodrigues Lordello <[email protected]> | 2024-07-25 21:07:06 +0200 |
| commit | fd50c91473eda09db01c63421fbb7084ed896494 (patch) | |
| tree | 4b5ac77e77c9bcfc0e15f526df24c69bbe3a2826 /test | |
| parent | ba751d469d6ae3a1e3f728726a1972d16d9bf1e4 (diff) | |
Cleaned Up Tests
Diffstat (limited to 'test')
| -rw-r--r-- | test/test_fp.ml | 17 | ||||
| -rw-r--r-- | test/test_fp12.ml | 1 | ||||
| -rw-r--r-- | test/test_fp2.ml | 1 |
3 files changed, 18 insertions, 1 deletions
diff --git a/test/test_fp.ml b/test/test_fp.ml index ca8f9e4..feefb5d 100644 --- a/test/test_fp.ml +++ b/test/test_fp.ml @@ -3,6 +3,20 @@ module Fp = Plonkers.Fields.Fp let fp = Testable.make Fp.to_string Fp.equal let f = Fp.of_string +let test_strconv () = + let a = + f + "15962132676900570984155932908734860654156982678903386073610512073739915079794" + in + Alcotest.(check string) + "equals" + "15962132676900570984155932908734860654156982678903386073610512073739915079794" + (Fp.to_string a); + Alcotest.(check fp) + "equals" a + (Fp.of_string + "15962132676900570984155932908734860654156982678903386073610512073739915079794") + let test_add () = Alcotest.(check fp) "equals" @@ -47,7 +61,7 @@ let test_sub () = "equals" (f "1550460075629904631277637708383660261580971272511193857451434052003108082807") - (Fp.add + (Fp.sub (f "1550460075629904631277637708383660261580971272511193857451434052003108082807") Fp.zero) @@ -133,6 +147,7 @@ let test_inv () = let tests = Alcotest. [ + test_case "String Conversion" `Quick test_strconv; test_case "Addition" `Quick test_add; test_case "Subtraction" `Quick test_sub; test_case "Multiplication" `Quick test_mul; diff --git a/test/test_fp12.ml b/test/test_fp12.ml index 2ded117..e8ee6e9 100644 --- a/test/test_fp12.ml +++ b/test/test_fp12.ml @@ -331,6 +331,7 @@ let test_inv () = let tests = Alcotest. [ + test_case "String Conversion" `Quick test_strconv; test_case "Addition" `Quick test_add; test_case "Subtraction" `Quick test_sub; test_case "Multiplication" `Quick test_mul; diff --git a/test/test_fp2.ml b/test/test_fp2.ml index 50a3dd8..828583f 100644 --- a/test/test_fp2.ml +++ b/test/test_fp2.ml @@ -116,6 +116,7 @@ let test_inv () = let tests = Alcotest. [ + test_case "String Conversion" `Quick test_strconv; test_case "Addition" `Quick test_add; test_case "Subtraction" `Quick test_sub; test_case "Multiplication" `Quick test_mul; |
