-
Notifications
You must be signed in to change notification settings - Fork 325
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'origin/develop' into mls
- Loading branch information
Showing
5 changed files
with
34 additions
and
5 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add parametrised tests |
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 |
---|---|---|
|
@@ -104,6 +104,7 @@ library | |
Testlib.Prekeys | ||
Testlib.Prelude | ||
Testlib.Printing | ||
Testlib.PTest | ||
Testlib.Run | ||
Testlib.Types | ||
|
||
|
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,27 @@ | ||
module Testlib.PTest where | ||
|
||
import Data.Aeson (Value (..)) | ||
import qualified Data.Text as T | ||
import Testlib.App | ||
import Testlib.JSON | ||
import Testlib.Types | ||
import Prelude | ||
|
||
type Test = (String, String, String, String, App ()) | ||
|
||
class HasTests x where | ||
mkTests :: String -> String -> String -> String -> x -> [Test] | ||
|
||
instance HasTests (App ()) where | ||
mkTests m n s f x = [(m, n, s, f, x)] | ||
|
||
data Domain = OwnDomain | OtherDomain | ||
|
||
instance MakesValue Domain where | ||
make OwnDomain = String . T.pack <$> ownDomain | ||
make OtherDomain = String . T.pack <$> otherDomain | ||
|
||
instance HasTests x => HasTests (Domain -> x) where | ||
mkTests m n s f x = | ||
mkTests m (n <> "[domain=own]") s f (x OwnDomain) | ||
<> mkTests m (n <> "[domain=other]") s f (x OtherDomain) |
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