diff options
| author | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 11:41:59 +0200 |
|---|---|---|
| committer | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 11:41:59 +0200 |
| commit | e504a829432d9a80357f6c6416b4510070919a1c (patch) | |
| tree | 0575723164acb818925db96c37b07605bc9b78b0 /tests | |
| parent | b298bab1bf4dc5fdd07de867ad922f0157abbaee (diff) | |
Normalize direct preview counts
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 |
