summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladislav Zavialov <vlad.z.4096@gmail.com>2019-12-28 01:59:33 +0300
committerVladislav Zavialov <vlad.z.4096@gmail.com>2019-12-30 08:43:21 -0500
commit0cd198178d67fbbd5304c8de9c1cc54226239080 (patch)
treec49328852155fce11d8ac31758be29eb037543f5
parent0d42b287c3fe2510433a7fb744531a0765ad8ac8 (diff)
downloadhaskell-wip/haddock-tests.tar.gz
Testsuite: update some Haddock testswip/haddock-tests
Fixed tests: * haddockA039: added to all.T * haddockE004: replaced with T17561 (marked as expect_broken) New tests: * haddockA040: deriving clause for a data instance * haddockA041: haddock and CPP #include
-rw-r--r--testsuite/tests/haddock/should_compile_flag_haddock/IncludeMe.hs2
-rw-r--r--testsuite/tests/haddock/should_compile_flag_haddock/T17561.hs2
-rw-r--r--testsuite/tests/haddock/should_compile_flag_haddock/T17561.stderr6
-rw-r--r--testsuite/tests/haddock/should_compile_flag_haddock/all.T4
-rw-r--r--testsuite/tests/haddock/should_compile_flag_haddock/haddockA039.stderr8
-rw-r--r--testsuite/tests/haddock/should_compile_flag_haddock/haddockA040.hs13
-rw-r--r--testsuite/tests/haddock/should_compile_flag_haddock/haddockA040.stderr13
-rw-r--r--testsuite/tests/haddock/should_compile_flag_haddock/haddockA041.hs6
-rw-r--r--testsuite/tests/haddock/should_compile_flag_haddock/haddockA041.stderr8
-rw-r--r--testsuite/tests/haddock/should_fail_flag_haddock/all.T1
-rw-r--r--testsuite/tests/haddock/should_fail_flag_haddock/haddockE004.hs3
-rw-r--r--testsuite/tests/haddock/should_fail_flag_haddock/haddockE004.stderr2
12 files changed, 60 insertions, 8 deletions
diff --git a/testsuite/tests/haddock/should_compile_flag_haddock/IncludeMe.hs b/testsuite/tests/haddock/should_compile_flag_haddock/IncludeMe.hs
new file mode 100644
index 0000000000..7de6c5eeb2
--- /dev/null
+++ b/testsuite/tests/haddock/should_compile_flag_haddock/IncludeMe.hs
@@ -0,0 +1,2 @@
+-- | Comment on T
+data T = MkT -- ^ Comment on MkT
diff --git a/testsuite/tests/haddock/should_compile_flag_haddock/T17561.hs b/testsuite/tests/haddock/should_compile_flag_haddock/T17561.hs
new file mode 100644
index 0000000000..0042aa5a91
--- /dev/null
+++ b/testsuite/tests/haddock/should_compile_flag_haddock/T17561.hs
@@ -0,0 +1,2 @@
+-- | Comment on the first declaration
+main = return ()
diff --git a/testsuite/tests/haddock/should_compile_flag_haddock/T17561.stderr b/testsuite/tests/haddock/should_compile_flag_haddock/T17561.stderr
new file mode 100644
index 0000000000..43971dfd1d
--- /dev/null
+++ b/testsuite/tests/haddock/should_compile_flag_haddock/T17561.stderr
@@ -0,0 +1,6 @@
+
+==================== Parser ====================
+<document comment>
+main = return ()
+
+
diff --git a/testsuite/tests/haddock/should_compile_flag_haddock/all.T b/testsuite/tests/haddock/should_compile_flag_haddock/all.T
index 72c913a42c..c7b9d91c25 100644
--- a/testsuite/tests/haddock/should_compile_flag_haddock/all.T
+++ b/testsuite/tests/haddock/should_compile_flag_haddock/all.T
@@ -49,7 +49,11 @@ test('haddockA038', normal, compile, ['-haddock -ddump-parsed'])
test('haddockA033', normal, compile, ['-haddock -ddump-parsed'])
test('haddockA034', normal, compile, ['-haddock -ddump-parsed'])
+test('haddockA039', normal, compile, ['-haddock -ddump-parsed'])
+test('haddockA040', normal, compile, ['-haddock -ddump-parsed'])
+test('haddockA041', [extra_files(['IncludeMe.hs'])], compile, ['-haddock -ddump-parsed'])
test('T10398', normal, compile, ['-haddock -ddump-parsed'])
test('T11768', normal, compile, ['-haddock -ddump-parsed'])
test('T15206', normal, compile, ['-haddock -ddump-parsed'])
test('T16585', normal, compile, ['-haddock -ddump-parsed'])
+test('T17561', expect_broken(17561), compile, ['-haddock -ddump-parsed'])
diff --git a/testsuite/tests/haddock/should_compile_flag_haddock/haddockA039.stderr b/testsuite/tests/haddock/should_compile_flag_haddock/haddockA039.stderr
index 0c12f5c62f..02bc5985b5 100644
--- a/testsuite/tests/haddock/should_compile_flag_haddock/haddockA039.stderr
+++ b/testsuite/tests/haddock/should_compile_flag_haddock/haddockA039.stderr
@@ -1,11 +1,15 @@
==================== Parser ====================
module CommentsBeforeArguments where
+data A = A
+data B = B
f1 ::
- () Comment before -> () Comment after -> () Result after
+ () " Comment before "
+ -> () " Comment after " -> () " Result after "
f1 _ _ = ()
f2 ::
- () Comment before -> () Comment after -> () Result after
+ () " Comment before "
+ -> () " Comment after " -> () " Result after "
f2 _ _ = ()
diff --git a/testsuite/tests/haddock/should_compile_flag_haddock/haddockA040.hs b/testsuite/tests/haddock/should_compile_flag_haddock/haddockA040.hs
new file mode 100644
index 0000000000..611f874a56
--- /dev/null
+++ b/testsuite/tests/haddock/should_compile_flag_haddock/haddockA040.hs
@@ -0,0 +1,13 @@
+{-# LANGUAGE TypeFamilies #-}
+
+module CommentsDataInstanceDeriving where
+
+-- | Comment on the U data family
+data family U a
+
+-- | Comment on the U () data instance
+data instance U () = UUnit
+ deriving ( Eq -- ^ Comment on the derived Eq (U ()) instance
+ , Ord -- ^ Comment on the derived Ord (U ()) instance
+ , Show -- ^ Comment on the derived Show (U ()) instance
+ )
diff --git a/testsuite/tests/haddock/should_compile_flag_haddock/haddockA040.stderr b/testsuite/tests/haddock/should_compile_flag_haddock/haddockA040.stderr
new file mode 100644
index 0000000000..7cbe964357
--- /dev/null
+++ b/testsuite/tests/haddock/should_compile_flag_haddock/haddockA040.stderr
@@ -0,0 +1,13 @@
+
+==================== Parser ====================
+module CommentsDataInstanceDeriving where
+<document comment>
+data family U a
+<document comment>
+data instance U ()
+ = UUnit
+ deriving (Eq " Comment on the derived Eq (U ()) instance",
+ Ord " Comment on the derived Ord (U ()) instance",
+ Show " Comment on the derived Show (U ()) instance")
+
+
diff --git a/testsuite/tests/haddock/should_compile_flag_haddock/haddockA041.hs b/testsuite/tests/haddock/should_compile_flag_haddock/haddockA041.hs
new file mode 100644
index 0000000000..fe9f7a24c4
--- /dev/null
+++ b/testsuite/tests/haddock/should_compile_flag_haddock/haddockA041.hs
@@ -0,0 +1,6 @@
+{-# LANGUAGE CPP #-}
+
+-- | Module header documentation
+module Comments_and_CPP_include where
+
+#include "IncludeMe.hs"
diff --git a/testsuite/tests/haddock/should_compile_flag_haddock/haddockA041.stderr b/testsuite/tests/haddock/should_compile_flag_haddock/haddockA041.stderr
new file mode 100644
index 0000000000..98e217c8ee
--- /dev/null
+++ b/testsuite/tests/haddock/should_compile_flag_haddock/haddockA041.stderr
@@ -0,0 +1,8 @@
+
+==================== Parser ====================
+" Module header documentation"
+module Comments_and_CPP_include where
+<document comment>
+data T = " Comment on MkT" MkT
+
+
diff --git a/testsuite/tests/haddock/should_fail_flag_haddock/all.T b/testsuite/tests/haddock/should_fail_flag_haddock/all.T
index bbe4c6edf2..811d13348a 100644
--- a/testsuite/tests/haddock/should_fail_flag_haddock/all.T
+++ b/testsuite/tests/haddock/should_fail_flag_haddock/all.T
@@ -1,4 +1,3 @@
#test('haddockE001', normal, compile_fail, ['-haddock'])
#test('haddockE002', normal, compile_fail, ['-haddock'])
#test('haddockE003', normal, compile_fail, ['-haddock'])
-test('haddockE004', normal, compile_fail, ['-haddock'])
diff --git a/testsuite/tests/haddock/should_fail_flag_haddock/haddockE004.hs b/testsuite/tests/haddock/should_fail_flag_haddock/haddockE004.hs
deleted file mode 100644
index d73fe8f796..0000000000
--- a/testsuite/tests/haddock/should_fail_flag_haddock/haddockE004.hs
+++ /dev/null
@@ -1,3 +0,0 @@
-
--- | awlkdajsads
-main=undefined
diff --git a/testsuite/tests/haddock/should_fail_flag_haddock/haddockE004.stderr b/testsuite/tests/haddock/should_fail_flag_haddock/haddockE004.stderr
deleted file mode 100644
index efd20d2ed1..0000000000
--- a/testsuite/tests/haddock/should_fail_flag_haddock/haddockE004.stderr
+++ /dev/null
@@ -1,2 +0,0 @@
-
-haddockE004.hs:3:1: parse error on input ‘main’