From e8f45e6571bd0249749c706e181a96e7010a0b3a Mon Sep 17 00:00:00 2001 From: Christopher Chang <51393127+chriscerie@users.noreply.github.com> Date: Sat, 11 Nov 2023 08:06:49 -0800 Subject: [PATCH] Add negated divide by zero test --- 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 + │ ^^^^^^ +