From 70c25c45d61926beca789fda0e57a10cbeef81e3 Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Thu, 22 Sep 2022 03:04:33 +0800 Subject: fixes #20397; fixes stylecheck regression (#20398) * fixes #20397; fixes stylecheck * add testcase --- tests/stylecheck/t20397.nim | 4 ++++ tests/stylecheck/t20397_1.nim | 8 ++++++++ tests/stylecheck/t20397_2.nim | 7 +++++++ 3 files changed, 19 insertions(+) create mode 100644 tests/stylecheck/t20397.nim create mode 100644 tests/stylecheck/t20397_1.nim create mode 100644 tests/stylecheck/t20397_2.nim (limited to 'tests') diff --git a/tests/stylecheck/t20397.nim b/tests/stylecheck/t20397.nim new file mode 100644 index 000000000..486a97d73 --- /dev/null +++ b/tests/stylecheck/t20397.nim @@ -0,0 +1,4 @@ +{.hintAsError[Name]:on.} +var a_b = 1 +discard a_b +{.hintAsError[Name]:off.} \ No newline at end of file diff --git a/tests/stylecheck/t20397_1.nim b/tests/stylecheck/t20397_1.nim new file mode 100644 index 000000000..24f5791f8 --- /dev/null +++ b/tests/stylecheck/t20397_1.nim @@ -0,0 +1,8 @@ +discard """ + matrix: "--styleCheck:off" +""" + +{.hintAsError[Name]:on.} +var a_b = 1 +discard a_b +{.hintAsError[Name]:off.} \ No newline at end of file diff --git a/tests/stylecheck/t20397_2.nim b/tests/stylecheck/t20397_2.nim new file mode 100644 index 000000000..3b8e1c4d6 --- /dev/null +++ b/tests/stylecheck/t20397_2.nim @@ -0,0 +1,7 @@ +discard """ + errormsg: "'a_b' should be: 'aB'" + matrix: "--styleCheck:error" +""" + +var a_b = 1 +discard a_b \ No newline at end of file -- cgit 1.4.1-2-gfad0