diff options
author | Zubin Duggal <zubin.duggal@gmail.com> | 2021-10-12 18:25:41 +0530 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-10-26 12:36:24 -0400 |
commit | 0255ef38b1bb0d4f3608bf92ebc8a93955ccb30a (patch) | |
tree | 718653d95e2d43388f6e20f7fa2057aee1282baf /testsuite/tests/warnings | |
parent | 0f7541dc37d25d8a1056586bbeb57bf0dd2826a0 (diff) | |
download | haskell-0255ef38b1bb0d4f3608bf92ebc8a93955ccb30a.tar.gz |
Warn if unicode bidirectional formatting characters are found in the source (#20263)
Diffstat (limited to 'testsuite/tests/warnings')
-rw-r--r-- | testsuite/tests/warnings/should_fail/T20263.hs | 2 | ||||
-rw-r--r-- | testsuite/tests/warnings/should_fail/T20263.stderr | 8 | ||||
-rw-r--r-- | testsuite/tests/warnings/should_fail/all.T | 1 |
3 files changed, 11 insertions, 0 deletions
diff --git a/testsuite/tests/warnings/should_fail/T20263.hs b/testsuite/tests/warnings/should_fail/T20263.hs new file mode 100644 index 0000000000..c04928e9a1 --- /dev/null +++ b/testsuite/tests/warnings/should_fail/T20263.hs @@ -0,0 +1,2 @@ +main :: IO () +main = print {- "Hello" -} "Goodbye" diff --git a/testsuite/tests/warnings/should_fail/T20263.stderr b/testsuite/tests/warnings/should_fail/T20263.stderr new file mode 100644 index 0000000000..5d7b260959 --- /dev/null +++ b/testsuite/tests/warnings/should_fail/T20263.stderr @@ -0,0 +1,8 @@ + +T20263.hs:2:17: error: [-Wunicode-bidirectional-format-characters (in -Wdefault), -Werror=unicode-bidirectional-format-characters] + A unicode bidirectional formatting character (U+2067 RIGHT-TO-LEFT ISOLATE (RLI)) + was found at offset 30 in the file + along with further bidirectional formatting characters at offset 31: U+2066 LEFT-TO-RIGHT ISOLATE (LRI) + offset 40: U+2069 POP DIRECTIONAL ISOLATE (PDI) + offset 41: U+2066 LEFT-TO-RIGHT ISOLATE (LRI) + Bidirectional formatting characters may be rendered misleadingly in certain editors diff --git a/testsuite/tests/warnings/should_fail/all.T b/testsuite/tests/warnings/should_fail/all.T index 075c790222..6eaf7af6fd 100644 --- a/testsuite/tests/warnings/should_fail/all.T +++ b/testsuite/tests/warnings/should_fail/all.T @@ -16,3 +16,4 @@ test('CaretDiagnostics1', ['-fdiagnostics-show-caret -ferror-spans']) test('CaretDiagnostics2', normal, compile_fail, ['-fdiagnostics-show-caret']) test('Colour', normal, compile_fail, ['-fdiagnostics-color=always']) +test('T20263', normal, compile_fail, ['-Wunicode-bidirectional-format-characters -Werror']) |