From 80b8a8a2525d4e4c60b7c9439a23ac47d9612802 Mon Sep 17 00:00:00 2001 From: Alec Theriault Date: Mon, 7 Oct 2019 15:13:52 -0400 Subject: Add a regression test for #1091 Previously, this input would crash Haddock. --- haddock.cabal | 1 + hypsrc-test/ref/src/Bug1091.html | 34 ++++++++++++++++++++++++++++++++++ hypsrc-test/src/Bug1091.hs | 4 ++++ hypsrc-test/src/Include1For1091.h | 6 ++++++ hypsrc-test/src/Include2For1091.h | 4 ++++ 5 files changed, 49 insertions(+) create mode 100644 hypsrc-test/ref/src/Bug1091.html create mode 100644 hypsrc-test/src/Bug1091.hs create mode 100644 hypsrc-test/src/Include1For1091.h create mode 100644 hypsrc-test/src/Include2For1091.h diff --git a/haddock.cabal b/haddock.cabal index 0173fd84..fa87e07e 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -46,6 +46,7 @@ extra-source-files: html-test/src/*.hs html-test/ref/*.html hypsrc-test/src/*.hs + hypsrc-test/src/*.h hypsrc-test/ref/src/*.html latex-test/src/**/*.hs latex-test/ref/**/*.tex diff --git a/hypsrc-test/ref/src/Bug1091.html b/hypsrc-test/ref/src/Bug1091.html new file mode 100644 index 00000000..730b6e25 --- /dev/null +++ b/hypsrc-test/ref/src/Bug1091.html @@ -0,0 +1,34 @@ +
{-# LANGUAGE CPP #-}
+module Bug1091 where
+
+#include "Include1For1091.h"
+
\ No newline at end of file diff --git a/hypsrc-test/src/Bug1091.hs b/hypsrc-test/src/Bug1091.hs new file mode 100644 index 00000000..f0cea033 --- /dev/null +++ b/hypsrc-test/src/Bug1091.hs @@ -0,0 +1,4 @@ +{-# LANGUAGE CPP #-} +module Bug1091 where + +#include "Include1For1091.h" diff --git a/hypsrc-test/src/Include1For1091.h b/hypsrc-test/src/Include1For1091.h new file mode 100644 index 00000000..32854b95 --- /dev/null +++ b/hypsrc-test/src/Include1For1091.h @@ -0,0 +1,6 @@ +/* Include1For1091.h */ + +foo :: Int +foo = 42 + +#include "Include2For1091.h" diff --git a/hypsrc-test/src/Include2For1091.h b/hypsrc-test/src/Include2For1091.h new file mode 100644 index 00000000..c0848fa9 --- /dev/null +++ b/hypsrc-test/src/Include2For1091.h @@ -0,0 +1,4 @@ +/* Include2For1091.h */ + +bar :: Int +bar = 27 -- cgit v1.2.3