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 +4 -4
- data/lib/haskell_file_hook.rb +1 -1
- data/lib/test_hook.rb +32 -58
- data/lib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4577dbd2f321c149250272c274e26961e32b7fd2e2b6d607aaec5ccbd4ad9a96
|
4
|
+
data.tar.gz: 773c258bb07174ee2ceac32843a1ca63db4c9c857b9386851893bb493513f030
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 920044ab330aedde0e1082e540fa33dc5e03cff3c758be74dd2f76d7e88e13c1dfc42d75dbf3162016f112b8a8d42521e8acc228568605fc4edc3e682fbc8f86
|
7
|
+
data.tar.gz: 0b379d9d11821bd76e8b6ebfc7c93f58c00d08b5ca128fbd71c362a5fb752de1e2ae25aa64fda0a9526a03af161c55ea5d851850a5863bfd42264913ca6358b9
|
data/lib/haskell_file_hook.rb
CHANGED
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
|
-
|
16
|
-
|
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
|
21
|
-
|
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
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.
|
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-
|
11
|
+
date: 2020-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mumukit
|