diff options
-rwxr-xr-x | testsuite/tests/ghci/scripts/all.T | 1 | ||||
-rw-r--r-- | testsuite/tests/ghci/scripts/ghci065.hs | 28 | ||||
-rw-r--r-- | testsuite/tests/ghci/scripts/ghci065.script | 11 | ||||
-rw-r--r-- | testsuite/tests/ghci/scripts/ghci065.stdout | 7 |
4 files changed, 47 insertions, 0 deletions
diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T index 9ba975172c..dedca954f2 100755 --- a/testsuite/tests/ghci/scripts/all.T +++ b/testsuite/tests/ghci/scripts/all.T @@ -107,6 +107,7 @@ test('ghci062', [extra_files(['ghci062/', 'ghci062/Test.hs']), ghci_script, ['ghci062.script']) test('ghci063', normal, ghci_script, ['ghci063.script']) test('ghci064', normal, ghci_script, ['ghci064.script']) +test('ghci065', [extra_hc_opts("-haddock")], ghci_script, ['ghci065.script']) test('T2452', [extra_hc_opts("-fno-implicit-import-qualified")], ghci_script, ['T2452.script']) test('T2766', normal, ghci_script, ['T2766.script']) diff --git a/testsuite/tests/ghci/scripts/ghci065.hs b/testsuite/tests/ghci/scripts/ghci065.hs new file mode 100644 index 0000000000..7035b4815d --- /dev/null +++ b/testsuite/tests/ghci/scripts/ghci065.hs @@ -0,0 +1,28 @@ +-- +-- This is a minimal test for :doc command. +-- +-- To avoid depending haddock's pretty-printing, +-- this test is constructed with simple text (without markup) only. +-- + +module Test where + +-- | This is the haddock comment of a data declaration for Data1. +data Data1 = Val1a | Val1b + +data Data2 = Val2a -- ^ This is the haddock comment of a data value for Val2a + | Val2b -- ^ This is the haddock comment of a data value for Val2b + + +-- | This is the haddock comment of a function declaration for func1. +func1 :: Int -> Int -> Int +func1 x y = x + y + +-- This is NOT a haddock comment. +func2 :: Int -> Int -> Int +func2 x y = x + y + +-- | This is the haddock comment of a function declaration for func3. +-- Here's multiple line comment for func3. +func3 :: Int -> Int -> Int +func3 x y = x + y diff --git a/testsuite/tests/ghci/scripts/ghci065.script b/testsuite/tests/ghci/scripts/ghci065.script new file mode 100644 index 0000000000..ec51b24fe5 --- /dev/null +++ b/testsuite/tests/ghci/scripts/ghci065.script @@ -0,0 +1,11 @@ +-- Testing :doc command simply + +:load ghci065 + +:doc Data1 +:doc Val2a +:doc Val2b + +:doc func1 +:doc func2 +:doc func3 diff --git a/testsuite/tests/ghci/scripts/ghci065.stdout b/testsuite/tests/ghci/scripts/ghci065.stdout new file mode 100644 index 0000000000..c3d69ca4ef --- /dev/null +++ b/testsuite/tests/ghci/scripts/ghci065.stdout @@ -0,0 +1,7 @@ + This is the haddock comment of a data declaration for Data1. + This is the haddock comment of a data value for Val2a + This is the haddock comment of a data value for Val2b + This is the haddock comment of a function declaration for func1. +<has no documentation> + This is the haddock comment of a function declaration for func3. + Here's multiple line comment for func3. |