Skip to content

Commit 631ef1f

Browse files
committed
Merge pull request #2 from cryogenian/ready/update
Update deps and travis
2 parents fd8c652 + 73f4881 commit 631ef1f

File tree

4 files changed

+46
-37
lines changed

4 files changed

+46
-37
lines changed

.travis.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ node_js:
55
env:
66
- TAG=v0.7.0 PATH=$HOME/bin:$PATH
77
install:
8-
- mkdir $HOME/bin
9-
- wget -O $HOME/purescript.tar.gz https://github.com/purescript/purescript/releases/download/$TAG/linux64.tar.gz
10-
- tar zxvf $HOME/purescript.tar.gz -C $HOME/bin purescript/psc{,i,-docs,-bundle,-publish} --strip-components=1
11-
- chmod a+x $HOME/bin/psc{,i,-docs,-bundle,-publish}
128
- npm install bower gulp -g
139
- npm install && bower install
1410
script:

bower.json

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,15 @@
1717
"package.json"
1818
],
1919
"dependencies": {
20-
"purescript-string-parsers": "^0.5.0",
21-
"purescript-pathy": "^0.2.0",
22-
"purescript-arrays": "^0.4.0",
23-
"purescript-lists": "^0.7.0",
24-
"purescript-maps": "^0.4.0",
25-
"purescript-integers": "^0.2.0",
26-
"purescript-globals": "^0.2.0"
20+
"purescript-arrays": "~0.4.2",
21+
"purescript-globals": "~0.2.1",
22+
"purescript-integers": "~0.2.1",
23+
"purescript-lists": "~0.7.5",
24+
"purescript-maps": "~0.5.0",
25+
"purescript-pathy": "~0.3.0",
26+
"purescript-string-parsers": "~0.6.0"
27+
},
28+
"devDependencies": {
29+
"purescript-exceptions": "~0.3.0"
2730
}
2831
}

package.json

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
{
2-
"name" : "purescript-uri",
2+
"name": "purescript-uri",
33
"private": true,
4-
"devDependencies": {
5-
"ioredis": "1.1.x",
6-
"gulp": "^3.8.11",
7-
"gulp-jscs": "^1.6.0",
8-
"gulp-jshint": "^1.11.2",
9-
"gulp-purescript": "^0.5.0",
10-
"gulp-run": "^1.6.8"
4+
"devDependencies": {},
5+
"dependencies": {
6+
"gulp": "^3.9.0",
7+
"gulp-purescript": "^0.7.0",
8+
"gulp-run": "^1.6.11",
9+
"purescript": "^0.7.4"
1110
}
12-
}
11+
}

test/Main.purs

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@ module Test.Main where
22

33
import Prelude
44
import Data.Either
5+
import Control.Apply
56
import Control.Monad.Eff
6-
import Control.Monad.Eff.Console
7+
import qualified Control.Monad.Eff.Console as C
8+
import Control.Monad.Eff.Exception
79
import Data.URI
810
import Data.URI.Types
911
import Text.Parsing.StringParser
1012

13+
1114
main = do
1215
test runParseURIRef "mongodb://localhost"
1316
test runParseURIRef "http://en.wikipedia.org/wiki/URI_scheme"
@@ -31,22 +34,30 @@ main = do
3134
test runParseURIRef "foo://info.example.com?fred"
3235
test runParseURIRef "ftp://cnn.example.com&[email protected]/top_story.htm"
3336

34-
log "\nFailing test cases: "
35-
test runParseURIRef "news:comp.infosystems.www.servers.unix"
36-
test runParseURIRef "tel:+1-816-555-1212"
37-
test runParseURIRef "urn:oasis:names:specification:docbook:dtd:xml:4.1.2"
38-
test runParseURIRef "mailto:[email protected]"
39-
test runParseURIRef "mailto:[email protected]"
40-
test runParseURIRef "../top_story.htm"
41-
test runParseURIRef "top_story.htm"
42-
test runParseURIRef "/top_story.htm"
37+
C.log "\nFailing test cases: "
38+
testFails runParseURIRef "news:comp.infosystems.www.servers.unix"
39+
testFails runParseURIRef "tel:+1-816-555-1212"
40+
testFails runParseURIRef "urn:oasis:names:specification:docbook:dtd:xml:4.1.2"
41+
testFails runParseURIRef "mailto:[email protected]"
42+
testFails runParseURIRef "mailto:[email protected]"
43+
testFails runParseURIRef "../top_story.htm"
44+
testFails runParseURIRef "top_story.htm"
45+
testFails runParseURIRef "/top_story.htm"
4346

4447

45-
test :: forall a. (String -> Either ParseError URIRef) -> String -> _
46-
test f s = do
47-
log $ "\nTrying to parse " ++ s ++ ""
48+
testCommon :: (String -> Eff _ Unit) -> (String -> Eff _ Unit) ->
49+
(String -> Either ParseError URIRef) -> String -> _
50+
testCommon leftMsg rightMsg f s = do
51+
C.log $ "\nTrying to parse " <> s <> ""
4852
case f s of
49-
(Left err) -> log $ " Parse failed: " ++ show err
50-
(Right x) -> do
51-
log $ " printURI: " ++ printURIRef x
52-
log $ " show: " ++ show x
53+
Left err -> leftMsg $ " Parse failed: " <> show err
54+
Right x -> do
55+
rightMsg $ " printURI: " <> printURIRef x
56+
<> "\n show: " <> show x
57+
58+
59+
test :: (String -> Either ParseError URIRef) -> String -> _
60+
test = testCommon (\x -> C.error x *> (throwException $ error x)) C.log
61+
62+
testFails :: (String -> Either ParseError URIRef) -> String -> _
63+
testFails = testCommon C.log (\x -> C.error x *> (throwException $ error x))

0 commit comments

Comments
 (0)