diff options
author | Alan Zimmerman <alan.zimm@gmail.com> | 2021-05-09 15:19:45 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-05-11 05:36:02 -0400 |
commit | 32367cac4e586fb5aedaa021b257388392d976c4 (patch) | |
tree | 059b555f27488b9d80bcd2fb566bc1d8969f7579 /testsuite/tests/printer | |
parent | 087ac4ebee39bacd90529cab0e88af85a903448b (diff) | |
download | haskell-32367cac4e586fb5aedaa021b257388392d976c4.tar.gz |
EPA: Use custom AnnsIf structure for HsIf and HsCmdIf
This clearly identifies the presence and location of optional
semicolons in an if statement.
Closes #19813
Diffstat (limited to 'testsuite/tests/printer')
-rw-r--r-- | testsuite/tests/printer/Makefile | 5 | ||||
-rw-r--r-- | testsuite/tests/printer/Test19813.hs | 20 | ||||
-rw-r--r-- | testsuite/tests/printer/all.T | 4 |
3 files changed, 29 insertions, 0 deletions
diff --git a/testsuite/tests/printer/Makefile b/testsuite/tests/printer/Makefile index fe95e5a237..de71d64b78 100644 --- a/testsuite/tests/printer/Makefile +++ b/testsuite/tests/printer/Makefile @@ -567,3 +567,8 @@ Test19784: Test19798: $(CHECK_PPR) $(LIBDIR) Test19798.hs $(CHECK_EXACT) $(LIBDIR) Test19798.hs + +.PHONY: Test19813 +Test19813: + # $(CHECK_PPR) $(LIBDIR) Test19813.hs + $(CHECK_EXACT) $(LIBDIR) Test19813.hs diff --git a/testsuite/tests/printer/Test19813.hs b/testsuite/tests/printer/Test19813.hs new file mode 100644 index 0000000000..d15536c032 --- /dev/null +++ b/testsuite/tests/printer/Test19813.hs @@ -0,0 +1,20 @@ +{-# LANGUAGE Arrows #-} +module Bar where + +import Control.Arrow +import Data.Text as Text + +replace :: Text -> Text +replace = Text.map (\c -> if c == '_' then '.'; else c) + +replace1 :: Text -> Text +replace1 = Text.map (\c -> if c == '_' ; then '.' else c) + +replace2 :: Text -> Text +replace2 = Text.map (\c -> if c == '_'; then '.'; else c) + +replace4 :: Text -> Text +replace4 = Text.map (\c -> if c == '_' then '.' else c) + +addA f g = proc x -> if x == 0 ; then returnA -< x + ; else returnA -< x diff --git a/testsuite/tests/printer/all.T b/testsuite/tests/printer/all.T index d73e82ad2a..d25cd2bf22 100644 --- a/testsuite/tests/printer/all.T +++ b/testsuite/tests/printer/all.T @@ -126,3 +126,7 @@ test('InTreeAnnotations1', ignore_stderr, makefile_test, ['InTreeAnnotations1']) test('Test19784', ignore_stderr, makefile_test, ['Test19784']) test('Test19798', ignore_stderr, makefile_test, ['Test19798']) + +# The exact printing manages the extra semicolons, normal ppr not, so +# disabled in the Makefile for this test. +test('Test19813', ignore_stderr, makefile_test, ['Test19813']) |