mumuki-haskell-runner 1.5.0 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7298c93467bcf1eefb0ae42a2df30276da87aef1ad5cdad377d1029f63a2e118
4
- data.tar.gz: da7960b7ed9f7f9de9960050c7dc6cc69f87b30b138587e8b31c4e7d2425a220
3
+ metadata.gz: 4577dbd2f321c149250272c274e26961e32b7fd2e2b6d607aaec5ccbd4ad9a96
4
+ data.tar.gz: 773c258bb07174ee2ceac32843a1ca63db4c9c857b9386851893bb493513f030
5
5
  SHA512:
6
- metadata.gz: 87d08ef31288041ce18aa7cf427a5c176d4aa8cf6cceb29e0041505de40353389dfd02244cda60d778efc51f2ea07aedfe24c24e797cb05a005ce7528ba73ad9
7
- data.tar.gz: fbc1194d768197e3c739986ff958b032c8e9bd88be0a31fe41a0ae1c72d8d77b243c51ca282a9482ee9a936bea0a8ef3469cef8cb51c464b4a5ce73fcd4f0797
6
+ metadata.gz: 920044ab330aedde0e1082e540fa33dc5e03cff3c758be74dd2f76d7e88e13c1dfc42d75dbf3162016f112b8a8d42521e8acc228568605fc4edc3e682fbc8f86
7
+ data.tar.gz: 0b379d9d11821bd76e8b6ebfc7c93f58c00d08b5ca128fbd71c362a5fb752de1e2ae25aa64fda0a9526a03af161c55ea5d851850a5863bfd42264913ca6358b9
@@ -1,4 +1,4 @@
1
- class HaskellFileHook < Mumukit::Templates::MultiFileHook
1
+ class HaskellFileHook < Mumukit::Templates::FileHook
2
2
  isolated true
3
3
 
4
4
  def cleanup_raw_result(result)
data/lib/test_hook.rb CHANGED
@@ -6,66 +6,40 @@ class HaskellTestHook < HaskellFileHook
6
6
  super(result).compact
7
7
  end
8
8
 
9
- def has_files?(_req)
10
- true
11
- end
12
-
13
9
  def compile_file_content(req)
14
- {
15
- 'Test.hs' => compile_test_file(req),
16
- 'Code.hs' => compile_code_file(req)
17
- }
10
+ <<-EOF
11
+ {-# OPTIONS_GHC -fdefer-type-errors #-}
12
+ import Test.Hspec
13
+ import Test.Hspec.Runner (hspecWith, defaultConfig, Config (configFormatter))
14
+ import Test.QuickCheck
15
+ import Test.Hspec.Formatters
16
+
17
+ import qualified Control.Exception as Exception
18
+
19
+ import Data.List
20
+
21
+ structured :: Formatter
22
+ structured = silent {
23
+ exampleSucceeded = \\p ->
24
+ writeTerm [formatPath p, "passed", ""],
25
+ exampleFailed = \\p result -> case result of
26
+ (Right e) -> writeTerm [formatPath p, "failed", e]
27
+ (Left e) -> writeTerm [formatPath p, "failed", show e],
28
+ headerFormatter = write $ "@@@RESULTS-START@@@[",
29
+ footerFormatter = write $ "null]"
30
+ }
31
+ where formatPath (ps, p) = intercalate " " $ (ps ++ [p])
32
+ writeTerm = write.(++",").show
33
+
34
+ #{req.content}
35
+ #{req.extra}
36
+ main :: IO ()
37
+ main = hspecWith defaultConfig {configFormatter = Just structured} $ do
38
+ #{req.test.lines.map {|it| ' ' + it}.join}
39
+ EOF
18
40
  end
19
41
 
20
- def compile_test_file(req)
21
- <<~HASKELL
22
- {-# OPTIONS_GHC -fdefer-type-errors #-}
23
- import Test.Hspec
24
- import Test.Hspec.Runner (hspecWith, defaultConfig, Config (configFormatter))
25
- import Test.QuickCheck
26
- import Test.Hspec.Formatters
27
- import Code
28
-
29
- import qualified Control.Exception as Exception
30
-
31
- import Data.List
32
-
33
- structured :: Formatter
34
- structured = silent {
35
- exampleSucceeded = \\p ->
36
- writeTerm [formatPath p, "passed", ""],
37
- exampleFailed = \\p result -> case result of
38
- (Right e) -> writeTerm [formatPath p, "failed", e]
39
- (Left e) -> writeTerm [formatPath p, "failed", show e],
40
- headerFormatter = write $ "@@@RESULTS-START@@@[",
41
- footerFormatter = write $ "null]"
42
- }
43
- where formatPath (ps, p) = intercalate " " $ (ps ++ [p])
44
- writeTerm = write.(++",").show
45
-
46
- main :: IO ()
47
- main = hspecWith defaultConfig {configFormatter = Just structured} $ do
48
- #{req.test.lines.map {|it| ' ' + it}.join}
49
- HASKELL
50
- end
51
-
52
- def compile_code_file(req)
53
- <<~HASKELL
54
- {-# OPTIONS_GHC -fdefer-type-errors #-}
55
- module Code where
56
-
57
- #{req.content}
58
- #{req.extra}
59
- HASKELL
60
- end
61
-
62
- def command_line(test_file, _code_file)
63
- ['bash', '-c', "cd #{dir_from_file_path test_file} && runhaskell #{test_file}"]
64
- end
65
-
66
- private
67
-
68
- def dir_from_file_path(file_path)
69
- file_path[/.*\//]
42
+ def command_line(filename)
43
+ "runhaskell #{filename}"
70
44
  end
71
45
  end
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module HaskellVersionHook
2
- VERSION = '1.5.0'
2
+ VERSION = '1.6.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumuki-haskell-runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franco Leonardo Bulgarelli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-27 00:00:00.000000000 Z
11
+ date: 2020-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mumukit