Browse Source

Now testing is done with Tasty.

Nicolas Lenz 2 months ago
parent
commit
8d442b3219
4 changed files with 19 additions and 9 deletions
  1. 5
    3
      katrin.cabal
  2. 3
    2
      package.yaml
  3. 1
    1
      stack.yaml
  4. 10
    3
      test/Main.hs

+ 5
- 3
katrin.cabal View File

@@ -4,7 +4,7 @@ cabal-version: 1.12
4 4
 --
5 5
 -- see: https://github.com/sol/hpack
6 6
 --
7
+-- hash: a51038a57a549df7c527a6c89f16e4bb448017a0a2ee08be5d89074747639e34
7 8
 
8 9
 name:           katrin
9 10
 version:        0.0.0
@@ -50,16 +50,17 @@ executable katrin
50 50
 
51 51
 test-suite katrin-test
52 52
   type: exitcode-stdio-1.0
53
-  main-is: Spec.hs
53
+  main-is: Main.hs
54 54
   other-modules:
55 55
       Paths_katrin
56 56
   hs-source-dirs:
57 57
       test
58 58
   ghc-options: -threaded -rtsopts -with-rtsopts=-N
59 59
   build-depends:
60
-      QuickCheck
61
-    , base >=4.7 && <5
60
+      base >=4.7 && <5
62 61
     , katrin
63 62
     , quickcheck-instances
63
+    , tasty
64
+    , tasty-quickcheck
64 65
     , text
65 66
   default-language: Haskell2010

+ 3
- 2
package.yaml View File

@@ -33,7 +33,7 @@ executables:
33 33
 
34 34
 tests:
35 35
   katrin-test:
36
-    main: Spec.hs
36
+    main: Main.hs
37 37
     source-dirs: test
38 38
     ghc-options:
39 39
     - -threaded
@@ -41,5 +41,6 @@ tests:
41 41
     - -with-rtsopts=-N
42 42
     dependencies:
43 43
     - katrin
44
-    - QuickCheck
44
+    - tasty
45
+    - tasty-quickcheck
45 46
     - quickcheck-instances

+ 1
- 1
stack.yaml View File

@@ -1,4 +1,4 @@
1
-resolver: lts-12.23
1
+resolver: lts-13.0
2 2
 
3 3
 packages:
4 4
 - .

test/Spec.hs → test/Main.hs View File

@@ -1,10 +1,17 @@
1
-import Test.QuickCheck
1
+module Main where
2
+
3
+import Test.Tasty
4
+import Test.Tasty.QuickCheck
2 5
 import Test.QuickCheck.Instances
3 6
 import Katrin
4 7
 import Data.Text
5 8
 
6 9
 main :: IO ()
7
-main = quickCheck prop_foldTermKatrinIdentic
10
+main = defaultMain test
11
+
12
+test :: TestTree
13
+test = testGroup "Main tests" [
14
+    testProperty "Identity of folding in Katrin term algebra" prop_foldTermKatrinIdentic]
8 15
 
9 16
 prop_foldTermKatrinIdentic :: Katrin -> Bool
10 17
 prop_foldTermKatrinIdentic k = foldKatrin katrinAlgTerm k == k
@@ -20,7 +27,7 @@ instance Arbitrary ConstrId where
20 27
 
21 28
 instance Arbitrary TypeDef where
22 29
     arbitrary = sized $ \n ->
23
-        TypeDef <$> arbitrary <*> (resize (n) arbitrary)
30
+        TypeDef <$> arbitrary <*> resize n arbitrary
24 31
 
25 32
 instance Arbitrary TypeExp where
26 33
     arbitrary = sized $ \n ->

Loading…
Cancel
Save