From 6e887086413dba68ff71f05cb5dd0b45f8836090 Mon Sep 17 00:00:00 2001 From: Chris Chang <51393127+chriscerie@users.noreply.github.com> Date: Sat, 11 Nov 2023 08:14:18 -0800 Subject: [PATCH] Add negated divide by zero test (#569) Closes #501. Actual fix is from #568. --- selene-lib/tests/lints/divide_by_zero/divide_by_zero.lua | 1 + selene-lib/tests/lints/divide_by_zero/divide_by_zero.stderr | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/selene-lib/tests/lints/divide_by_zero/divide_by_zero.lua b/selene-lib/tests/lints/divide_by_zero/divide_by_zero.lua index 5e902c2b..9b9422ce 100644 --- a/selene-lib/tests/lints/divide_by_zero/divide_by_zero.lua +++ b/selene-lib/tests/lints/divide_by_zero/divide_by_zero.lua @@ -3,3 +3,4 @@ local _ = 5 / 0 local _ = 0 / 5 local _ = x / 0 local _ = 0 / 0 +local _ = -1 / 0 \ No newline at end of file diff --git a/selene-lib/tests/lints/divide_by_zero/divide_by_zero.stderr b/selene-lib/tests/lints/divide_by_zero/divide_by_zero.stderr index b645f171..67b56525 100644 --- a/selene-lib/tests/lints/divide_by_zero/divide_by_zero.stderr +++ b/selene-lib/tests/lints/divide_by_zero/divide_by_zero.stderr @@ -10,3 +10,9 @@ error[divide_by_zero]: dividing by zero is not allowed, use math.huge instead 4 │ local _ = x / 0 │ ^^^^^ +error[divide_by_zero]: dividing by zero is not allowed, use math.huge instead + ┌─ divide_by_zero.lua:6:11 + │ +6 │ local _ = -1 / 0 + │ ^^^^^^ +