diff --git a/.travis.yml b/.travis.yml index 968390b..d980b08 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,12 +2,20 @@ language: node_js dist: trusty sudo: required node_js: stable +env: + - PATH=$HOME/purescript:$PATH install: + - TAG=$(wget -q -O - https://github.com/purescript/purescript/releases/latest --server-response --max-redirect 0 2>&1 | sed -n -e 's/.*Location:.*tag\///p') + - wget -O $HOME/purescript.tar.gz https://github.com/purescript/purescript/releases/download/$TAG/linux64.tar.gz + - tar -xvf $HOME/purescript.tar.gz -C $HOME/ + - chmod a+x $HOME/purescript - npm install -g bower - npm install - - bower install script: + - bower install --production - npm run -s build + - bower install + - npm run -s test after_success: - >- test $TRAVIS_TAG && diff --git a/bower.json b/bower.json index e57093f..43401e1 100644 --- a/bower.json +++ b/bower.json @@ -5,6 +5,10 @@ ], "description": "A library for dealing with nulls", "license": "MIT", + "repository": { + "type": "git", + "url": "git://github.com/purescript-contrib/purescript-nullable.git" + }, "ignore": [ "**/.*", "bower_components", @@ -14,14 +18,10 @@ "package.json" ], "dependencies": { - "purescript-maybe": "^3.0.0", - "purescript-functions": "^3.0.0" - }, - "repository": { - "type": "git", - "url": "git://github.com/paf31/purescript-nullable.git" + "purescript-maybe": "^4.0.0", + "purescript-functions": "^4.0.0" }, "devDependencies": { - "purescript-console": "^3.0.0" + "purescript-assert": "^4.0.0" } } diff --git a/package.json b/package.json index b6361b9..6615039 100644 --- a/package.json +++ b/package.json @@ -6,10 +6,9 @@ "test": "pulp test" }, "devDependencies": { - "eslint": "^3.19.0", - "pulp": "^11.0.0", - "purescript": "^0.11.1", - "purescript-psa": "^0.5.0", - "rimraf": "^2.6.1" + "eslint": "^4.19.1", + "pulp": "^12.2.0", + "purescript-psa": "^0.6.0", + "rimraf": "^2.6.2" } } diff --git a/test/Main.purs b/test/Main.purs index 2c2d456..a5733aa 100644 --- a/test/Main.purs +++ b/test/Main.purs @@ -2,18 +2,26 @@ module Test.Main where import Prelude -import Control.Monad.Eff (Eff) -import Control.Monad.Eff.Console (CONSOLE, logShow) import Data.Maybe (Maybe(..)) import Data.Nullable (toNullable, toMaybe) +import Effect (Effect) +import Test.Assert (assertEqual) -main :: Eff (console :: CONSOLE) Unit +main :: Effect Unit main = do - logShow $ toNullable (Nothing :: Maybe Number) - logShow $ toNullable (Just 42) - - logShow $ toMaybe $ toNullable (Nothing :: Maybe Number) - logShow $ toMaybe $ toNullable (Just 42) - - logShow $ toNullable Nothing == toNullable (Just 42) - logShow $ toNullable Nothing `compare` toNullable (Just 42) + assertEqual + { actual: toMaybe $ toNullable (Nothing :: Maybe Number) + , expected: Nothing + } + assertEqual + { actual: toMaybe $ toNullable (Just 42) + , expected: Just 42 + } + assertEqual + { actual: toNullable Nothing == toNullable (Just 42) + , expected: false + } + assertEqual + { actual: toNullable Nothing `compare` toNullable (Just 42) + , expected: LT + }