aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test_formatting.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/test_formatting.py b/test/test_formatting.py
index 18f582c..177912d 100644
--- a/test/test_formatting.py
+++ b/test/test_formatting.py
@@ -1,6 +1,7 @@
import pytest
import numpy as np
from ee.formatting import eng_str
+from ee import EeVal
@pytest.mark.parametrize("input,expected", [
@@ -60,3 +61,16 @@ def xx_test_eng_str2(input, expected):
])
def xx_test_eng_str3(input, expected):
assert expected == eng_str(input)
+
+
+@pytest.mark.parametrize("s, expected", [
+ ('1', EeVal("1")),
+ ('10', EeVal("10")),
+ ('10k', EeVal("10e3")),
+ ('10 k', EeVal("10e3")),
+ ('10 k', EeVal("10e3")),
+ ('1p', EeVal("1e-9")),
+ ('100n', EeVal("100e-6")),
+ ])
+def test_EeVal(s, expected):
+ assert expected == EeVal(s)