diff --git a/selene-lib/tests/lints/approx_constant/approx_constant.lua b/selene-lib/tests/lints/approx_constant/approx_constant.lua index ce8d2987..bf22d7cf 100644 --- a/selene-lib/tests/lints/approx_constant/approx_constant.lua +++ b/selene-lib/tests/lints/approx_constant/approx_constant.lua @@ -2,6 +2,7 @@ local good = 3 local good = 3.1 local good = 3.13 local good = 3.15 +local good = -3.15 local good = 3.1417 local good = 3.14159266 @@ -10,9 +11,11 @@ local good = 3_14 local bad = 3.14 local bad = 3.141 +local bad = -3.141 local bad = 3.142 local bad = 3.1415 local bad = 3.14159265 local bad = 3.14 + 1 local bad = f(3.14 + 1) +local bad = f(-3.14 + 1) diff --git a/selene-lib/tests/lints/approx_constant/approx_constant.stderr b/selene-lib/tests/lints/approx_constant/approx_constant.stderr index e84a8fcd..9743cf84 100644 --- a/selene-lib/tests/lints/approx_constant/approx_constant.stderr +++ b/selene-lib/tests/lints/approx_constant/approx_constant.stderr @@ -1,42 +1,54 @@ error[approx_constant]: `math.pi` is more precise - ┌─ approx_constant.lua:11:13 + ┌─ approx_constant.lua:12:13 │ -11 │ local bad = 3.14 +12 │ local bad = 3.14 │ ^^^^ error[approx_constant]: `math.pi` is more precise - ┌─ approx_constant.lua:12:13 + ┌─ approx_constant.lua:13:13 │ -12 │ local bad = 3.141 +13 │ local bad = 3.141 │ ^^^^^ error[approx_constant]: `math.pi` is more precise - ┌─ approx_constant.lua:13:13 + ┌─ approx_constant.lua:14:14 + │ +14 │ local bad = -3.141 + │ ^^^^^ + +error[approx_constant]: `math.pi` is more precise + ┌─ approx_constant.lua:15:13 │ -13 │ local bad = 3.142 +15 │ local bad = 3.142 │ ^^^^^ error[approx_constant]: `math.pi` is more precise - ┌─ approx_constant.lua:14:13 + ┌─ approx_constant.lua:16:13 │ -14 │ local bad = 3.1415 +16 │ local bad = 3.1415 │ ^^^^^^ error[approx_constant]: `math.pi` is more precise - ┌─ approx_constant.lua:15:13 + ┌─ approx_constant.lua:17:13 │ -15 │ local bad = 3.14159265 +17 │ local bad = 3.14159265 │ ^^^^^^^^^^ error[approx_constant]: `math.pi` is more precise - ┌─ approx_constant.lua:17:13 + ┌─ approx_constant.lua:19:13 │ -17 │ local bad = 3.14 + 1 +19 │ local bad = 3.14 + 1 │ ^^^^ error[approx_constant]: `math.pi` is more precise - ┌─ approx_constant.lua:18:15 + ┌─ approx_constant.lua:20:15 │ -18 │ local bad = f(3.14 + 1) +20 │ local bad = f(3.14 + 1) │ ^^^^ +error[approx_constant]: `math.pi` is more precise + ┌─ approx_constant.lua:21:16 + │ +21 │ local bad = f(-3.14 + 1) + │ ^^^^ +