Skip to content

Commit 3710dcf

Browse files
committed
tests: don't desugar dispatch for existing tests
1 parent 6c71d70 commit 3710dcf

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

test/Cases.hs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,15 @@ spec =
5656
where
5757
specFolder = "./test/examples/spec"
5858

59+
dispatches :: TestTree
60+
dispatches =
61+
testGroup
62+
"Files for dispatch cases"
63+
[ runDispatchTest "basic.solc"
64+
]
65+
where
66+
runDispatchTest file = runTestForFileWith (emptyOption mempty) file "./test/examples/dispatch"
67+
5968
imports :: TestTree
6069
imports =
6170
testGroup
@@ -175,7 +184,6 @@ cases =
175184
, runTestExpectingFailure "pragma_merge_fail_coverage.solc" caseFolder
176185
, runTestForFile "single-lambda.solc" caseFolder
177186
, runTestForFile "match-yul.solc" caseFolder
178-
, runTestForFile "dispatch.solc" stdFolder
179187
]
180188
where
181189
caseFolder = "./test/examples/cases"
@@ -186,7 +194,9 @@ type FileName = String
186194
type BaseFolder = String
187195

188196
runTestForFile :: FileName -> BaseFolder -> TestTree
189-
runTestForFile file folder = runTestForFileWith (emptyOption mempty) file folder
197+
runTestForFile file folder = runTestForFileWith option file folder
198+
where
199+
option = stdOpt { optNoGenDispatch = True }
190200

191201
runTestForFileWith :: Option -> FileName -> BaseFolder -> TestTree
192202
runTestForFileWith opts file folder =
@@ -198,8 +208,9 @@ runTestForFileWith opts file folder =
198208
Right _ -> return ()
199209

200210
runTestExpectingFailure :: FileName -> BaseFolder -> TestTree
201-
runTestExpectingFailure file folder
202-
= runTestExpectingFailureWith (emptyOption mempty) file folder
211+
runTestExpectingFailure file folder = runTestExpectingFailureWith option file folder
212+
where
213+
option = stdOpt { optNoGenDispatch = True }
203214

204215
runTestExpectingFailureWith :: Option -> FileName -> BaseFolder -> TestTree
205216
runTestExpectingFailureWith opts file folder =

test/Main.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ tests
1515
, spec
1616
, std
1717
, imports
18+
, dispatches
1819
-- , reduceTests
1920
]

0 commit comments

Comments
 (0)