diff options
author | Vladislav Zavialov <vlad.z.4096@gmail.com> | 2019-12-28 01:59:33 +0300 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-12-31 14:23:10 -0500 |
commit | d710fd666a70ae100120042c8549634537001609 (patch) | |
tree | 17388650feec4765c86617248eafc3339e6fee75 | |
parent | eb6082358cdb5f271a8e4c74044a12f97352c52f (diff) | |
download | haskell-d710fd666a70ae100120042c8549634537001609.tar.gz |
Testsuite: update some 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
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’ |