From f636b3d18c9c30b763c625092129342636cad633 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=A4llberg?= Date: Sun, 22 Sep 2024 19:19:09 +0200 Subject: [PATCH] Add test case for #351 (crash on parse failure for deriving clause) --- test/AllFailTests.agda | 1 + test/Fail/DerivingParseFailure.agda | 6 ++++++ test/golden/DerivingParseFailure.err | 2 ++ 3 files changed, 9 insertions(+) create mode 100644 test/Fail/DerivingParseFailure.agda create mode 100644 test/golden/DerivingParseFailure.err diff --git a/test/AllFailTests.agda b/test/AllFailTests.agda index 41173e28..24deabc8 100644 --- a/test/AllFailTests.agda +++ b/test/AllFailTests.agda @@ -39,3 +39,4 @@ import Fail.NonCanonicalSuperclass import Fail.Issue125 import Fail.Issue357a import Fail.Issue357b +import Fail.DerivingParseFailure diff --git a/test/Fail/DerivingParseFailure.agda b/test/Fail/DerivingParseFailure.agda new file mode 100644 index 00000000..c31e2084 --- /dev/null +++ b/test/Fail/DerivingParseFailure.agda @@ -0,0 +1,6 @@ +module Fail.DerivingParseFailure where + +record Example : Set where +{-# COMPILE AGDA2HS Example deriving !& #-} +-- {-# COMPILE AGDA2HS Example deriving Show via Foo #-} +-- {-# COMPILE AGDA2HS Example deriving (Show, Eq, Ord) class #-} diff --git a/test/golden/DerivingParseFailure.err b/test/golden/DerivingParseFailure.err new file mode 100644 index 00000000..a74ff5db --- /dev/null +++ b/test/golden/DerivingParseFailure.err @@ -0,0 +1,2 @@ +test/Fail/DerivingParseFailure.agda:4,1-44 +Parse error: !&