diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/run.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/run.lua b/tests/run.lua index cbca8d9..7c4c52d 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -4614,6 +4614,17 @@ test("Upper-case descriptors scan direct previews backward", function() ) end) +test("Direct preview count normalizes absent and entered values", function() + local planner = direct_preview_planner.new() + same(1, planner:normalize_count(nil)) + same(1, planner:normalize_count(domain.Count.ONE)) + same(2, planner:normalize_count(2)) + same(3, planner:normalize_count(domain.Count.new(3))) + fails(function() + planner:normalize_count(0) + end, "positive integer") +end) + for _, item in ipairs(tests) do local ok, failure = xpcall(item.body, debug.traceback) if not ok then |
