From 862d0462e56f1472b0bc9119286618b2127427d4 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Sat, 16 May 2020 15:16:01 +0200 Subject: 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. --- lulua/test_report.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'lulua/test_report.py') 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] -- cgit v1.2.3