on master help sign in
Merge branch 'master' into topic/kbd_caper
9a56f13John P Mayer Jr
Elm.cabal+1−1
@@ -168,4 +168,4 @@ Test-Suite test-elm
168 Type: exitcode-stdio-1.0
168 Type: exitcode-stdio-1.0
169 Hs-Source-Dirs: tests
169 Hs-Source-Dirs: tests
170 Main-is: Main.hs
170 Main-is: Main.hs
171− build-depends: base, HTF
171+ build-depends: base, directory, HTF
compiler/Generate/JavaScript.hs+8−8
@@ -297,14 +297,14 @@ matchToJS span match =
297clauseToJS span var (Clause value vars e) = do
297clauseToJS span var (Clause value vars e) = do
298 let vars' = map (\n -> var ++ "._" ++ show n) [0..]
298 let vars' = map (\n -> var ++ "._" ++ show n) [0..]
299 s <- matchToJS span $ matchSubst (zip vars vars') e
299 s <- matchToJS span $ matchSubst (zip vars vars') e
300− return $ concat [ "\ncase ", case value of
300+ pattern <- case value of
301− Right (Boolean True) -> "true"
301+ Right (Boolean True) -> return "true"
302− Right (Boolean False) -> "false"
302+ Right (Boolean False) -> return "false"
303− Right lit -> show lit
303+ Right lit -> toJS lit
304− Left name -> quoted $ case List.elemIndices '.' name of
304+ Left name -> return . quoted $ case List.elemIndices '.' name of
305− [] -> name
305+ [] -> name
306− is -> drop (last is + 1) name
306+ is -> drop (last is + 1) name
307− , ":", indent s ]
307+ return $ concat [ "\ncase ", pattern, ":", indent s ]
308
308
309jsNil = "_L.Nil"
309jsNil = "_L.Nil"
310jsCons e1 e2 = "_L.Cons(" ++ e1 ++ "," ++ e2 ++ ")"
310jsCons e1 e2 = "_L.Cons(" ++ e1 ++ "," ++ e2 ++ ")"
compiler/Parse/Type.hs+1−1
@@ -64,7 +64,7 @@ expr :: IParser T.Type
64expr =
64expr =
65 do t1 <- app <|> term
65 do t1 <- app <|> term
66 whitespace
66 whitespace
67− arr <- optionMaybe arrow
67+ arr <- optionMaybe (try arrow)
68 whitespace
68 whitespace
69 case arr of
69 case arr of
70 Just _ -> T.Lambda t1 <$> expr
70 Just _ -> T.Lambda t1 <$> expr
runtime/Render/Element.js+2−2
@@ -252,9 +252,9 @@ function updateProps(node, curr, next) {
252 e.style.opacity = props.opacity;
252 e.style.opacity = props.opacity;
253 }
253 }
254 var nextColor = (props.color.ctor === 'Just' ?
254 var nextColor = (props.color.ctor === 'Just' ?
255− extract(props.color._0) : 'transparent');
255+ extract(props.color._0) : '');
256 if (e.style.backgroundColor !== nextColor) {
256 if (e.style.backgroundColor !== nextColor) {
257− e.style.backgroundColor = nextColor;
257+ e.style.backgroundColor = (nextColor === '' ? 'transparent' : nextColor);
258 }
258 }
259 if (props.tag !== currP.tag) { e.id = props.tag; }
259 if (props.tag !== currP.tag) { e.id = props.tag; }
260 if (props.href !== currP.href) {
260 if (props.href !== currP.href) {
runtime/Render/Utils.js+2−2
@@ -14,8 +14,8 @@ function addTo(container, elem) {
14}
14}
15
15
16function extract(c) {
16function extract(c) {
17− if (c._3 === 1) { return 'rgb(' + c._0 + ',' + c._1 + ',' + c._2 + ')'; }
17+ if (c._3 === 1) { return 'rgb(' + c._0 + ', ' + c._1 + ', ' + c._2 + ')'; }
18− return 'rgba(' + c._0 + ',' + c._1 + ',' + c._2 + ',' + c._3 + ')';
18+ return 'rgba(' + c._0 + ', ' + c._1 + ', ' + c._2 + ', ' + c._3 + ')';
19}
19}
20
20
21function addTransform(style, trans) {
21function addTransform(style, trans) {
tests/Main.hs+16−3
@@ -1,9 +1,22 @@
1module Main where
1module Main where
2
2
3+import System.Directory
4+import System.Exit (exitWith)
5+import System.Environment (getArgs)
3−import Test.Framework
6+import Test.Framework.TestManager
4import Test.Framework.BlackBoxTest
7import Test.Framework.BlackBoxTest
5
8
6main :: IO ()
9main :: IO ()
7−main = htfMain tests
10+main = do
11+ args <- getArgs
12+ tests <- blackBoxTests "tests/good" "dist/build/elm/elm" ".elm" bbtArgs
13+ code <- runTestWithArgs args tests
14+ removeDirectoryRecursive "cache"
15+ removeDirectoryRecursive "build"
16+ exitWith code
8
17
9−tests = blackBoxTests "tests/good" "dist/build/elm/elm" ".elm" defaultBBTArgs
18+bbtArgs = defaultBBTArgs { bbtArgs_stdoutDiff = ignoreDiff
19+ , bbtArgs_stderrDiff = ignoreDiff }
20+
21+ignoreDiff :: Diff
22+ignoreDiff _ _ = return Nothing
tests/testdeleted−7
@@ -1,7 +0,0 @@
1−#!/bin/sh
2−(
3− cd `dirname $0` &&
4− cabal configure --enable-tests &&
5− cabal build &&
6− cabal test
7−) || exit 1
tests/testRepldeleted−5
@@ -1,5 +0,0 @@
1−#!/bin/sh
2−
3−here=`cd \`dirname $0\` && pwd`
4−cd "$here/tests" &&
5−ghci
tests/tests/.ghcideleted−5
@@ -1,5 +0,0 @@
1−:set -i../src -i.
2−:l Main Parse.Parser
3−:m + Test.QuickCheck Main
4−:set prompt "test>> "
5−:set -Wall