summaryrefslogtreecommitdiff
path: root/source/Test/Unit/Module.hs
diff options
context:
space:
mode:
authoradelon <22380201+adelon@users.noreply.github.com>2026-07-31 21:52:15 +0200
committeradelon <22380201+adelon@users.noreply.github.com>2026-07-31 21:52:15 +0200
commitb4dac1818cdfddd11a0d75e2dfca4946bfc9cc4f (patch)
treea0e052df615ee73197b179c4c5c5d7ea1adb708a /source/Test/Unit/Module.hs
parent2de1777a4afcbc5da0b2c8e5e8083f19724da883 (diff)
Require stores for verification commands
Diffstat (limited to 'source/Test/Unit/Module.hs')
-rw-r--r--source/Test/Unit/Module.hs57
1 files changed, 16 insertions, 41 deletions
diff --git a/source/Test/Unit/Module.hs b/source/Test/Unit/Module.hs
index 5df30ae..7ebc317 100644
--- a/source/Test/Unit/Module.hs
+++ b/source/Test/Unit/Module.hs
@@ -24,9 +24,7 @@ import Bound.Scope (fromScope)
import Bound.Var (Var(..))
import Data.ByteString qualified as ByteString
import Data.Text.Encoding qualified as Text
-import Control.Exception (try)
import Control.Monad.Logger (runNoLoggingT)
-import Control.Monad.Reader (runReaderT)
import System.Directory (getCurrentDirectory)
import System.FilePath.Posix qualified as Posix
import Test.Tasty
@@ -298,20 +296,13 @@ resetsGlossStatePerModule = do
rejectsUnsupportedTypedSource :: Assertion
rejectsUnsupportedTypedSource = do
result <-
- try
- (runNoLoggingT
- (runReaderT
- (Api.verifyMeasured
- (Provers.vampire
- "vampire"
- Provers.defaultTimeLimit
- Provers.defaultMemoryLimit)
- "test/phase3/typed-unsupported.tex")
- testOptions))
- :: IO
- (Either
- Api.VerificationDriverError
- (Api.VerificationResult, Api.VerificationMeasurements))
+ runNoLoggingT
+ (Api.verifyMeasured
+ (Provers.vampire
+ "vampire"
+ Provers.defaultTimeLimit
+ Provers.defaultMemoryLimit)
+ "test/phase3/typed-unsupported.tex")
case result of
Left
(Api.VerificationTypedModuleError
@@ -347,16 +338,15 @@ routesProductionVerification = do
importer
where
verifyFixture path =
- runNoLoggingT
- (runReaderT
- (fst
- <$> Api.verifyMeasured
- (Provers.vampire
- "vampire"
- Provers.defaultTimeLimit
- Provers.defaultMemoryLimit)
- path)
- testOptions)
+ fst
+ <$> (runNoLoggingT
+ (Api.verifyMeasured
+ (Provers.vampire
+ "vampire"
+ Provers.defaultTimeLimit
+ Provers.defaultMemoryLimit)
+ path)
+ >>= expectRight)
assertRoute label expected = \case
Api.VerifiedWithTrustedVampire report ->
@@ -368,21 +358,6 @@ routesProductionVerification = do
Api.VerificationFailure failure ->
assertFailure (label <> " failed: " <> show failure)
-testOptions :: Api.Options
-testOptions = Api.Options
- { Api.inputPath = ""
- , Api.withDump = Api.WithoutDump
- , Api.withFilter = Api.WithoutFilter
- , Api.withLogging = Api.WithoutLogging
- , Api.withMemoryLimit = Provers.defaultMemoryLimit
- , Api.withOmissions = Api.WithOmissions
- , Api.withParseOnly = Api.WithoutParseOnly
- , Api.withTimeLimit = Provers.defaultTimeLimit
- , Api.withVersion = Api.WithoutVersion
- , Api.withHtml = Api.WithoutHtml
- , Api.withDumpPremselTraining = Api.WithoutDumpPremselTraining
- }
-
unusedResolver :: Declaration.VampireResolver
unusedResolver =
Declaration.vampireResolver \_prepared ->