Skip to content

Commit 0929360

Browse files
committed
test_misc: cover negative IEC binary prefixes in si_prefix
Adds tests for mi, µi, ni, pi, fi, ai, zi, yi, ri, qi at exactly 1.0 of each prefix (i.e. 1 / 1024**N for N = 1..10). The mi and µi prefixes were partially exercised before; the rest were uncovered.
1 parent cdce47a commit 0929360

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

unpythonic/tests/test_misc.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,16 @@ class Safe(MetalBox):
228228
test[the[si_prefix(-1536, binary=True)] == "-1.50 Ki"]
229229
test[the[si_prefix(0.5, binary=True)] == "512.00 mi"]
230230
test[the[si_prefix(0.5 / 1024, binary=True)] == "512.00 µi"]
231-
test[the[si_prefix(1 / 1024, binary=True)] == "1.00 mi"]
231+
test[the[si_prefix(1 / 1024, binary=True)] == "1.00 mi"] # mibi
232+
test[the[si_prefix(1 / 1024**2, binary=True)] == "1.00 µi"] # microbi
233+
test[the[si_prefix(1 / 1024**3, binary=True)] == "1.00 ni"] # nino
234+
test[the[si_prefix(1 / 1024**4, binary=True)] == "1.00 pi"] # pithon
235+
test[the[si_prefix(1 / 1024**5, binary=True)] == "1.00 fi"]
236+
test[the[si_prefix(1 / 1024**6, binary=True)] == "1.00 ai"] # AI
237+
test[the[si_prefix(1 / 1024**7, binary=True)] == "1.00 zi"]
238+
test[the[si_prefix(1 / 1024**8, binary=True)] == "1.00 yi"]
239+
test[the[si_prefix(1 / 1024**9, binary=True)] == "1.00 ri"]
240+
test[the[si_prefix(1 / 1024**10, binary=True)] == "1.00 qi"] # chi
232241

233242
if __name__ == '__main__': # pragma: no cover
234243
with session(__file__):

0 commit comments

Comments
 (0)