diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2020-05-16 15:16:01 +0200 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2020-05-16 15:19:53 +0200 |
commit | 862d0462e56f1472b0bc9119286618b2127427d4 (patch) | |
tree | 1c23251f0e666dbae28ae4c3b42888533e8b7337 /lulua/test_report.py | |
parent | 244197b5f8b1f4d73d4ab9ac838334860b55662c (diff) | |
download | lulua-862d0462e56f1472b0bc9119286618b2127427d4.tar.gz lulua-862d0462e56f1472b0bc9119286618b2127427d4.tar.bz2 lulua-862d0462e56f1472b0bc9119286618b2127427d4.zip |
report: Add simple sentence effort visualization
Trying to give the reader a sense for how difficult carpalx thinks
certain parts of a sentence are. Conclusions are only valid for a single
layout and comparison between them is not possible.
Diffstat (limited to 'lulua/test_report.py')
-rw-r--r-- | lulua/test_report.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lulua/test_report.py b/lulua/test_report.py index 16a751a..448d796 100644 --- a/lulua/test_report.py +++ b/lulua/test_report.py @@ -20,7 +20,7 @@ from decimal import Decimal -from .report import approx +from .report import approx, blend, blendn def test_approx (): assert approx (0) == (Decimal ('0'), '') @@ -37,4 +37,13 @@ def test_approx (): assert approx (10**9) == (Decimal ('1'), 'billion') assert approx (10**12) == (Decimal ('1000'), 'billion') +def test_blend (): + assert blend (0.5, 0, 1) == 0.5 + assert blend (0.5, 0, 2) == 1 + + assert blend (0.1, 0, 1) == 0.1 + assert blend (0.9, 0, 1) == 0.9 + + assert blendn (0.5, (0, ), (1, )) == [0.5] + assert blendn (0.5, (0, ), (0.7, ), (1, )) == [0.7] |