-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: Create primer-testlib
and primer-rel8-testlib
packages.
#758
Merged
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
4397143
refactor: Create a new primer-testlib package.
dhess 3dafde0
refactor: Use `primer-testlib` in `primer-rel8-test`.
dhess dba9da3
refactor: Move comprehensive test app into `primer-testlib`.
dhess 5be9b70
refactor: Use `primer-testlib` in `primer-service` tests.
dhess c205415
refactor: Create a new `primer-rel8-testlib` package.
dhess 8fade54
refactor: Use `primer-rel8-testlib` in `primer-service` tests.
dhess d98b203
refactor: More DRY for `primer-rel8-testlib`.
dhess 2ecbb8b
fix: Remove some dead code detected by `weeder`.
dhess File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
module Primer.Test.App ( | ||
comprehensive, | ||
) where | ||
|
||
import Foreword | ||
|
||
import Data.Map.Strict qualified as Map | ||
import Primer.App ( | ||
App, | ||
Prog (..), | ||
defaultProg, | ||
mkApp, | ||
) | ||
import Primer.Core ( | ||
baseName, | ||
mkSimpleModuleName, | ||
) | ||
import Primer.Core.DSL (create) | ||
import Primer.Examples qualified as Examples | ||
import Primer.Module ( | ||
Module ( | ||
Module, | ||
moduleDefs, | ||
moduleName, | ||
moduleTypes | ||
), | ||
builtinModule, | ||
primitiveModule, | ||
) | ||
|
||
-- | An initial test 'App' instance that contains all default type | ||
-- definitions (including primitive types), all primitive functions, | ||
-- and a top-level definition with extensive coverage of Primer's | ||
-- core language. | ||
comprehensive :: App | ||
comprehensive = | ||
let modName = mkSimpleModuleName "TestModule" | ||
((defName, def), id_) = create $ Examples.comprehensive modName | ||
testProg = | ||
defaultProg | ||
{ progImports = [builtinModule, primitiveModule] | ||
, progModules = | ||
[ Module | ||
{ moduleName = mkSimpleModuleName "TestModule" | ||
, moduleTypes = mempty | ||
, moduleDefs = Map.singleton (baseName defName) def | ||
} | ||
] | ||
} | ||
in mkApp id_ (toEnum 0) testProg |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this
comprehensive
differ fromPrimer.Examples.comprehensive
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is an
App
, the other is aMonadFresh ID m => ModuleName -> m (GVarName, Def)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yes, I see. This one wraps the
Examples
one in anApp