summaryrefslogtreecommitdiff
path: root/testsuite/tests/parser
diff options
context:
space:
mode:
authorDave Laing <dave.laing.80@gmail.com>2015-04-02 18:51:46 +0200
committerThomas Miedema <thomasmiedema@gmail.com>2015-04-02 18:58:19 +0200
commitafcfb62b748c41d31b8c8e3ef7f623fa00a1cfd2 (patch)
tree6ad9012fc934df998cbfa20d8371ea7ddfc6aec0 /testsuite/tests/parser
parent4c1e1c870e294990a44d8d6837742fb0d00f5456 (diff)
downloadhaskell-afcfb62b748c41d31b8c8e3ef7f623fa00a1cfd2.tar.gz
Change 'Tab character' warnings so there is one per file (#9723)
Reviewed By: nomeata, thomie Differential Revision: https://phabricator.haskell.org/D760 Signed-off-by: Dave Laing <dave.laing.80@gmail.com>
Diffstat (limited to 'testsuite/tests/parser')
-rw-r--r--testsuite/tests/parser/should_compile/T9723a.hs9
-rw-r--r--testsuite/tests/parser/should_compile/T9723a.stderr4
-rw-r--r--testsuite/tests/parser/should_compile/T9723b.hs22
-rw-r--r--testsuite/tests/parser/should_compile/T9723b.stderr4
-rw-r--r--testsuite/tests/parser/should_compile/all.T2
-rw-r--r--testsuite/tests/parser/should_compile/read043.stderr6
6 files changed, 44 insertions, 3 deletions
diff --git a/testsuite/tests/parser/should_compile/T9723a.hs b/testsuite/tests/parser/should_compile/T9723a.hs
new file mode 100644
index 0000000000..b75944ab18
--- /dev/null
+++ b/testsuite/tests/parser/should_compile/T9723a.hs
@@ -0,0 +1,9 @@
+
+{-# OPTIONS -fwarn-tabs #-}
+
+-- Check we get a warning for a single tab
+
+module ShouldCompile where
+
+tab1 = 'a'
+
diff --git a/testsuite/tests/parser/should_compile/T9723a.stderr b/testsuite/tests/parser/should_compile/T9723a.stderr
new file mode 100644
index 0000000000..c445de1046
--- /dev/null
+++ b/testsuite/tests/parser/should_compile/T9723a.stderr
@@ -0,0 +1,4 @@
+
+T9723a.hs:8:5: Warning:
+ Tab character found here.
+ Please use spaces instead.
diff --git a/testsuite/tests/parser/should_compile/T9723b.hs b/testsuite/tests/parser/should_compile/T9723b.hs
new file mode 100644
index 0000000000..d84e24c041
--- /dev/null
+++ b/testsuite/tests/parser/should_compile/T9723b.hs
@@ -0,0 +1,22 @@
+
+{-# OPTIONS -fwarn-tabs #-}
+
+-- Check we get a warning for multiple tabs, with the correct number of tabs
+-- mentioned
+
+module ShouldCompile where
+
+-- tab in middle of line
+tab1 = 'a'
+-- tab at end of line
+tab2 = 'b'
+-- two tabs in middle of line
+tab3 = 'c'
+
+tab4 = if True
+-- tab at start of line
+ then 'd'
+-- tab at start of line
+ else 'e'
+
+ -- tab before a comment starts
diff --git a/testsuite/tests/parser/should_compile/T9723b.stderr b/testsuite/tests/parser/should_compile/T9723b.stderr
new file mode 100644
index 0000000000..2526450363
--- /dev/null
+++ b/testsuite/tests/parser/should_compile/T9723b.stderr
@@ -0,0 +1,4 @@
+
+T9723b.hs:9:5: Warning:
+ Tab character found here, and in six further locations.
+ Please use spaces instead.
diff --git a/testsuite/tests/parser/should_compile/all.T b/testsuite/tests/parser/should_compile/all.T
index 13acedf014..6eb593a94c 100644
--- a/testsuite/tests/parser/should_compile/all.T
+++ b/testsuite/tests/parser/should_compile/all.T
@@ -98,3 +98,5 @@ test('T7118', normal, compile, [''])
test('T7776', normal, compile, [''])
test('RdrNoStaticPointers01', when(compiler_lt('ghc', '7.9'), skip), compile, [''])
test('T5682', normal, compile, [''])
+test('T9723a', normal, compile, [''])
+test('T9723b', normal, compile, [''])
diff --git a/testsuite/tests/parser/should_compile/read043.stderr b/testsuite/tests/parser/should_compile/read043.stderr
index dc1e84466a..76b1fb46ec 100644
--- a/testsuite/tests/parser/should_compile/read043.stderr
+++ b/testsuite/tests/parser/should_compile/read043.stderr
@@ -1,4 +1,4 @@
-read043.hs:8:5: Warning: Tab character
-
-read043.hs:10:5: Warning: Tab character
+read043.hs:8:5: Warning:
+ Tab character found here, and in one further location.
+ Please use spaces instead.