diff options
author | Kevin Buhr <buhr@asaurus.net> | 2019-05-06 23:05:34 -0500 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-07-08 07:07:11 -0400 |
commit | 5af815f2e43e9f1b5ca9ec0803f9fccabb49e2fe (patch) | |
tree | d8ed55b199f911c67416d5a88a9fae9c261bec6d /testsuite/tests/parser/should_compile | |
parent | 03f5adcd62fb1c6676f8b9e77723bac514ac8e9d (diff) | |
download | haskell-5af815f2e43e9f1b5ca9ec0803f9fccabb49e2fe.tar.gz |
Add test for old issue w/ bad source locations for warnings in .lhs files (#515)
Diffstat (limited to 'testsuite/tests/parser/should_compile')
-rw-r--r-- | testsuite/tests/parser/should_compile/T515.lhs | 9 | ||||
-rw-r--r-- | testsuite/tests/parser/should_compile/T515.stderr | 18 | ||||
-rw-r--r-- | testsuite/tests/parser/should_compile/all.T | 1 |
3 files changed, 28 insertions, 0 deletions
diff --git a/testsuite/tests/parser/should_compile/T515.lhs b/testsuite/tests/parser/should_compile/T515.lhs new file mode 100644 index 0000000000..20286cd8d6 --- /dev/null +++ b/testsuite/tests/parser/should_compile/T515.lhs @@ -0,0 +1,9 @@ +In #515, an LHS file gave warnings attributed to the wrong source location +(i.e., line 1). This regression tests makes sure they are attributed to +the correct line. + +> module Test where +> a = 1 +> b = 2 + +The above should attribute the warnings to lines 6 and 7. diff --git a/testsuite/tests/parser/should_compile/T515.stderr b/testsuite/tests/parser/should_compile/T515.stderr new file mode 100644 index 0000000000..dde5d47b0e --- /dev/null +++ b/testsuite/tests/parser/should_compile/T515.stderr @@ -0,0 +1,18 @@ + +T515.lhs:6:3: warning: [-Wmissing-signatures (in -Wall)] + Top-level binding with no type signature: a :: Integer + +T515.lhs:6:7: warning: [-Wtype-defaults (in -Wall)] + Defaulting the following constraint to type ‘Integer’ + Num p0 arising from the literal ‘1’ + In the expression: 1 + In an equation for ‘a’: a = 1 + +T515.lhs:7:3: warning: [-Wmissing-signatures (in -Wall)] + Top-level binding with no type signature: b :: Integer + +T515.lhs:7:7: warning: [-Wtype-defaults (in -Wall)] + Defaulting the following constraint to type ‘Integer’ + Num p0 arising from the literal ‘2’ + In the expression: 2 + In an equation for ‘b’: b = 2 diff --git a/testsuite/tests/parser/should_compile/all.T b/testsuite/tests/parser/should_compile/all.T index 8ea9cce13d..ef76f3ac52 100644 --- a/testsuite/tests/parser/should_compile/all.T +++ b/testsuite/tests/parser/should_compile/all.T @@ -144,3 +144,4 @@ test('T15781', normal, compile, ['']) test('T16339', normal, compile, ['']) test('T16619', requires_th, multimod_compile, ['T16619', '-v0']) test('T504', normal, compile, ['']) +test('T515', literate, compile, ['-Wall']) |