diff options
author | ringabout <43030857+ringabout@users.noreply.github.com> | 2022-09-22 03:04:33 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-21 15:04:33 -0400 |
commit | 70c25c45d61926beca789fda0e57a10cbeef81e3 (patch) | |
tree | 415eead4b0f5c8cb57b099e7d53e533ba90e261f /tests | |
parent | 4133698f2de09cd4d1c9ff3ef44dd0bb6e31693a (diff) | |
download | Nim-70c25c45d61926beca789fda0e57a10cbeef81e3.tar.gz |
fixes #20397; fixes stylecheck regression (#20398)
* fixes #20397; fixes stylecheck * add testcase
Diffstat (limited to 'tests')
-rw-r--r-- | tests/stylecheck/t20397.nim | 4 | ||||
-rw-r--r-- | tests/stylecheck/t20397_1.nim | 8 | ||||
-rw-r--r-- | tests/stylecheck/t20397_2.nim | 7 |
3 files changed, 19 insertions, 0 deletions
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 |