git.iko.soy/ikoHSE/test-task
on master help sign in
README.mdnew file+1
since splitsnapshots
unifiedsplit
@@ -0,0 +1 @@
1+# test-task
Setup.hsnew file+2
@@ -0,0 +1,2 @@
1+import Distribution.Simple
2+main = defaultMain
package.yamlnew file+17
@@ -0,0 +1,17 @@
1+name: test-task
2+version: 0.1.0.0
3+
4+dependencies:
5+ - base >= 4.7 && < 5
6+
7+library:
8+ source-dirs: src
9+
10+tests:
11+ task-tests:
12+ source-dirs: test
13+ main: Main.hs
14+ dependencies:
15+ - tasty
16+ - tasty-hspec
17+ - test-task
src/Task.hsnew file+7
@@ -0,0 +1,7 @@
1+module Task
2+ ( fib,
3+ )
4+where
5+
6+fib :: [Integer]
7+fib = undefined
stack.yamlnew file+4
@@ -0,0 +1,4 @@
1+resolver: lts-14.20
2+
3+packages:
4+- .
test-task.cabalnew file+37
@@ -0,0 +1,37 @@
1+cabal-version: 1.12
2+
3+-- This file has been generated from package.yaml by hpack version 0.31.2.
4+--
5+-- see: https://github.com/sol/hpack
6+--
7+-- hash: e08361617b0dffad45b26478b3c8c0ed2284c213c13214faddcc6dcfa42805a9
8+
9+name: test-task
10+version: 0.1.0.0
11+build-type: Simple
12+
13+library
14+ exposed-modules:
15+ Task
16+ other-modules:
17+ Paths_test_task
18+ hs-source-dirs:
19+ src
20+ build-depends:
21+ base >=4.7 && <5
22+ default-language: Haskell2010
23+
24+test-suite task-tests
25+ type: exitcode-stdio-1.0
26+ main-is: Main.hs
27+ other-modules:
28+ Tests
29+ Paths_test_task
30+ hs-source-dirs:
31+ test
32+ build-depends:
33+ base >=4.7 && <5
34+ , tasty
35+ , tasty-hspec
36+ , test-task
37+ default-language: Haskell2010
test/Main.hsnew file+18
@@ -0,0 +1,18 @@
1+{-# LANGUAGE ImplicitParams #-}
2+{-# LANGUAGE OverloadedStrings #-}
3+
4+module Main
5+ ( main,
6+ )
7+where
8+
9+import Test.Tasty
10+import Test.Tasty.Hspec
11+import Tests
12+
13+main :: IO ()
14+main = do
15+ tests' <- testSpecs tests
16+ defaultMain
17+ ( testGroup "tests" tests'
18+ )
test/Tests.hsnew file+16
@@ -0,0 +1,16 @@
1+module Tests
2+ ( tests,
3+ )
4+where
5+
6+import Task
7+import Test.Tasty.Hspec
8+
9+tests :: Spec
10+tests =
11+ specify "fib" $ do
12+ take 5 fib `shouldBe` [1, 1, 2, 3, 5]
13+ fib !! 10 `shouldBe` 89
14+ fib !! 22 `shouldBe` 28657
15+ fib !! 111 `shouldBe` 114059301025943970552219
16+ fib !! 150 `shouldBe` 16130531424904581415797907386349