diff --git a/.travis.yml b/.travis.yml index d7aba3f..ce338ca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,15 @@ node_js: - "node" language: node_js +env: + - PATH=$HOME/purescript:$PATH install: - - npm install -g purescript pulp bower + - 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 pulp + - npm install - bower install script: - pulp test diff --git a/bower.json b/bower.json index 5535bc6..b7f5f56 100644 --- a/bower.json +++ b/bower.json @@ -15,15 +15,15 @@ "output" ], "dependencies": { - "purescript-aff": "#compiler/0.12", - "purescript-either": "#compiler/0.12", - "purescript-prelude": "#compiler/0.12", - "purescript-effect": "#compiler/0.12", - "purescript-quickcheck": "#compiler/0.12", - "purescript-free": "#compiler/0.12", - "purescript-strings": "#compiler/0.12", - "purescript-lists": "#compiler/0.12", - "purescript-js-timers": "#compiler/0.12", - "purescript-avar": "#compiler/0.12" + "purescript-aff": "^5.0.0", + "purescript-either": "^4.0.0", + "purescript-prelude": "^4.0.0", + "purescript-effect": "^2.0.0", + "purescript-quickcheck": "^5.0.0", + "purescript-free": "^5.0.0", + "purescript-strings": "^4.0.0", + "purescript-lists": "^5.0.0", + "purescript-js-timers": "^4.0.0", + "purescript-avar": "^3.0.0" } } diff --git a/test/Main.purs b/test/Main.purs index e28a0fd..515f0db 100644 --- a/test/Main.purs +++ b/test/Main.purs @@ -17,6 +17,9 @@ import Test.Unit.QuickCheck (quickCheck) theCommutativeProperty :: Int -> Int -> Result theCommutativeProperty a b = (a + b) === (b + a) +modify' :: forall a. (a -> a) -> Ref.Ref a -> Effect Unit +modify' m s = void $ Ref.modify m s + tests :: Ref.Ref Int -> TestSuite tests ref = do test "basic asserts" do @@ -33,7 +36,7 @@ tests ref = do test "a test in a test suite" do pure unit test "tests run only once: part 1" do - liftEffect $ Ref.modify (_ + 1) ref + liftEffect $ modify' (_ + 1) ref test "tests run only once: part deux" do Assert.equal 1 =<< liftEffect (Ref.read ref) suite "another suite" do @@ -63,14 +66,14 @@ main = run do failure "skippedTestError" suite "not skipped suite" do test "not skipped test" do - liftEffect $ Ref.modify (add 1) var1 + liftEffect $ modify' (add 1) var1 pure unit suiteSkip "skipped subsuite" do test "skip 3" do failure "skippedTestError" suite "not skipped inner suite" do test "also not skipped" do - liftEffect $ Ref.modify (add 1) var1 + liftEffect $ modify' (add 1) var1 pure unit runTestWith Fancy.runTest do @@ -81,7 +84,7 @@ main = run do var2 <- liftEffect $ Ref.new 0 runTestWith Fancy.runTest do testOnly "only 1" do - liftEffect $ Ref.modify (add 1) var2 + liftEffect $ modify' (add 1) var2 pure unit test "skipped 1" do failure "onlyTestError" @@ -89,7 +92,7 @@ main = run do test "skipped 2" do failure "onlyTestError" testOnly "only 2" do - liftEffect $ Ref.modify (add 1) var2 + liftEffect $ modify' (add 1) var2 pure unit suite "empty suite" do test "skipped 3" do