summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2011-09-27 13:46:43 +0100
committerIan Lynagh <igloo@earth.li>2011-09-27 13:46:43 +0100
commitf8e0e9ed2ddecb712c1f4be05d69448a21f3bf82 (patch)
tree2d3848ef67df4f7baf9b4295da594ac478c84249 /testsuite
parent11152ac00090709e1b3d1cf2823e12cd7cfbed16 (diff)
downloadhaskell-f8e0e9ed2ddecb712c1f4be05d69448a21f3bf82.tar.gz
Add tests for NoTraditionalRecordSyntax
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/parser/should_fail/all.T4
-rw-r--r--testsuite/tests/parser/should_fail/readFailTraditionalRecords1.hs6
-rw-r--r--testsuite/tests/parser/should_fail/readFailTraditionalRecords1.stderr3
-rw-r--r--testsuite/tests/parser/should_fail/readFailTraditionalRecords2.hs7
-rw-r--r--testsuite/tests/parser/should_fail/readFailTraditionalRecords2.stderr3
-rw-r--r--testsuite/tests/parser/should_fail/readFailTraditionalRecords3.hs6
-rw-r--r--testsuite/tests/parser/should_fail/readFailTraditionalRecords3.stderr3
7 files changed, 32 insertions, 0 deletions
diff --git a/testsuite/tests/parser/should_fail/all.T b/testsuite/tests/parser/should_fail/all.T
index 31ec0d9a3e..65fba07ce5 100644
--- a/testsuite/tests/parser/should_fail/all.T
+++ b/testsuite/tests/parser/should_fail/all.T
@@ -69,3 +69,7 @@ test('T3811f', normal, compile_fail, [''])
test('T3811g', normal, compile_fail, [''])
test('NoDoAndIfThenElse', normal, compile_fail, [''])
test('NondecreasingIndentationFail', normal, compile_fail, [''])
+test('readFailTraditionalRecords1', normal, compile_fail, [''])
+test('readFailTraditionalRecords2', normal, compile_fail, [''])
+test('readFailTraditionalRecords3', normal, compile_fail, [''])
+
diff --git a/testsuite/tests/parser/should_fail/readFailTraditionalRecords1.hs b/testsuite/tests/parser/should_fail/readFailTraditionalRecords1.hs
new file mode 100644
index 0000000000..bde5527f7a
--- /dev/null
+++ b/testsuite/tests/parser/should_fail/readFailTraditionalRecords1.hs
@@ -0,0 +1,6 @@
+
+{-# LANGUAGE NoTraditionalRecordSyntax #-}
+
+module ReadFailTraditionalRecords1 where
+
+data Foo = Foo { i :: Int }
diff --git a/testsuite/tests/parser/should_fail/readFailTraditionalRecords1.stderr b/testsuite/tests/parser/should_fail/readFailTraditionalRecords1.stderr
new file mode 100644
index 0000000000..34887ef0b5
--- /dev/null
+++ b/testsuite/tests/parser/should_fail/readFailTraditionalRecords1.stderr
@@ -0,0 +1,3 @@
+
+readFailTraditionalRecords1.hs:6:16:
+ Illegal record syntax (use -XTraditionalRecordSyntax): {i :: Int}
diff --git a/testsuite/tests/parser/should_fail/readFailTraditionalRecords2.hs b/testsuite/tests/parser/should_fail/readFailTraditionalRecords2.hs
new file mode 100644
index 0000000000..bf67863dac
--- /dev/null
+++ b/testsuite/tests/parser/should_fail/readFailTraditionalRecords2.hs
@@ -0,0 +1,7 @@
+
+{-# LANGUAGE NoTraditionalRecordSyntax #-}
+
+module ReadFailTraditionalRecords2 where
+
+f (Foo { i = j }) = j
+
diff --git a/testsuite/tests/parser/should_fail/readFailTraditionalRecords2.stderr b/testsuite/tests/parser/should_fail/readFailTraditionalRecords2.stderr
new file mode 100644
index 0000000000..a2d6bb3a39
--- /dev/null
+++ b/testsuite/tests/parser/should_fail/readFailTraditionalRecords2.stderr
@@ -0,0 +1,3 @@
+
+readFailTraditionalRecords2.hs:6:4:
+ Illegal record syntax (use -XTraditionalRecordSyntax): Foo {i = j}
diff --git a/testsuite/tests/parser/should_fail/readFailTraditionalRecords3.hs b/testsuite/tests/parser/should_fail/readFailTraditionalRecords3.hs
new file mode 100644
index 0000000000..3d9c6e79fa
--- /dev/null
+++ b/testsuite/tests/parser/should_fail/readFailTraditionalRecords3.hs
@@ -0,0 +1,6 @@
+
+{-# LANGUAGE NoTraditionalRecordSyntax #-}
+
+module ReadFailTraditionalRecords3 where
+
+f x = x { i = 3 }
diff --git a/testsuite/tests/parser/should_fail/readFailTraditionalRecords3.stderr b/testsuite/tests/parser/should_fail/readFailTraditionalRecords3.stderr
new file mode 100644
index 0000000000..678486d0bc
--- /dev/null
+++ b/testsuite/tests/parser/should_fail/readFailTraditionalRecords3.stderr
@@ -0,0 +1,3 @@
+
+readFailTraditionalRecords3.hs:6:7:
+ Illegal record syntax (use -XTraditionalRecordSyntax): x {i = 3}