diff options
| author | J08nY | 2020-02-11 20:44:45 +0100 |
|---|---|---|
| committer | J08nY | 2020-02-11 20:44:45 +0100 |
| commit | 11bd56b296f1620932f098a6037f0807e7f6616f (patch) | |
| tree | 2a791114a710ab49af523cf1ba2144646ef9ad90 /test/ec/test_op.py | |
| parent | 4e2bd346baf2db39391deb49e9bdb9d89f94101a (diff) | |
| download | pyecsca-11bd56b296f1620932f098a6037f0807e7f6616f.tar.gz pyecsca-11bd56b296f1620932f098a6037f0807e7f6616f.tar.zst pyecsca-11bd56b296f1620932f098a6037f0807e7f6616f.zip | |
Diffstat (limited to 'test/ec/test_op.py')
| -rw-r--r-- | test/ec/test_op.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ec/test_op.py b/test/ec/test_op.py index a7f9cd0..9471148 100644 --- a/test/ec/test_op.py +++ b/test/ec/test_op.py @@ -1,8 +1,10 @@ +import ast from ast import parse from unittest import TestCase from parameterized import parameterized +from pyecsca.ec.formula import OpResult from pyecsca.ec.mod import Mod from pyecsca.ec.op import CodeOp, OpType @@ -35,3 +37,10 @@ class OpTests(TestCase): op = CodeOp(code) res = op(**locals) self.assertEqual(res, result) + +class OpResultTests(TestCase): + + def test_str(self): + for op, char in zip((ast.Add(), ast.Sub(), ast.Mult(), ast.Div()), "+-*/"): + res = OpResult("X1", Mod(0, 5), op, Mod(2, 5), Mod(3, 5)) + self.assertEqual(str(res), "X1")
\ No newline at end of file |
