From ed4cd13f12b4d170bf566382192ac2834e2b32b1 Mon Sep 17 00:00:00 2001 From: Gary Burgess Date: Fri, 25 Apr 2014 21:58:03 +0100 Subject: [PATCH] Remove test-related stuff (moved to core-tests) --- Gruntfile.js | 25 +++-------------- bower.json | 5 +--- package.json | 5 ++-- tests/Tests.purs | 70 ------------------------------------------------ 4 files changed, 6 insertions(+), 99 deletions(-) delete mode 100644 tests/Tests.purs diff --git a/Gruntfile.js b/Gruntfile.js index e82a5d2..ebb0820 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -11,36 +11,17 @@ module.exports = function(grunt) { clean: { dedupe: ["bower_components/purescript-maybe"], - tests: ["tmp"], lib: ["js", "externs"] }, pscMake: ["<%=libFiles%>"], - dotPsci: ["<%=libFiles%>"], - - psc: { - tests: { - options: { - module: ["Main"], - main: true - }, - src: ["tests/Tests.purs", "<%=libFiles%>"], - dest: "tmp/tests.js" - } - }, - - execute: { - tests: { - src: "tmp/tests.js" - } - } + dotPsci: ["<%=libFiles%>"] + }); grunt.loadNpmTasks("grunt-contrib-clean"); grunt.loadNpmTasks("grunt-purescript"); - grunt.loadNpmTasks("grunt-execute"); - grunt.registerTask("test", ["clean:dedupe", "clean:tests", "psc:tests", "execute:tests"]); grunt.registerTask("make", ["clean:dedupe", "pscMake", "dotPsci"]); - grunt.registerTask("default", ["test", "make"]); + grunt.registerTask("default", ["make"]); }; diff --git a/bower.json b/bower.json index 65f021e..f02a221 100644 --- a/bower.json +++ b/bower.json @@ -16,8 +16,5 @@ "bower.json", "Gruntfile.js", "package.json" - ], - "devDependencies": { - "purescript-quickcheck": "*" - } + ] } diff --git a/package.json b/package.json index 009a66e..8878a3e 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,9 @@ { "name": "purescript-maybe", - "version": "0.1.0", + "private": true, "devDependencies": { "grunt": "~0.4.4", "grunt-purescript": "~0.5.0", - "grunt-contrib-clean": "~0.5.0", - "grunt-execute": "~0.1.5" + "grunt-contrib-clean": "~0.5.0" } } diff --git a/tests/Tests.purs b/tests/Tests.purs deleted file mode 100644 index 0d3bc50..0000000 --- a/tests/Tests.purs +++ /dev/null @@ -1,70 +0,0 @@ -module Main where - -import Data.Maybe -import Debug.Trace -import Control.Monad.Eff -import Test.QuickCheck -import Test.QuickCheck.Functions -import Test.QuickCheck.Classes - -type Ty = Maybe Number - -main = do - - let ty = Just 0 - - trace "test equality" - check1 $ \n -> Just n == Just n - assert $ Nothing == Nothing :: Ty - - trace "test inequality" - check1 $ \n -> Just n /= Nothing - check1 $ \n -> Nothing /= Just n - check1 $ \n -> Just n /= Just (n + 1) - - trace "test order" - check2 $ \x y -> compare (Just x) (Just y) == compare x y - check1 $ \x -> compare Nothing (Just x) == LT - check1 $ \x -> compare (Just x) Nothing == GT - check1 $ \x -> compare Nothing (Nothing :: Ty) == EQ - - trace "maybe should transform a value wrapped in a Just" - check1 $ \n -> maybe 0 negate (Just n) == -n - - trace "maybe should return the default value when applied to Nothing" - check1 $ \n -> maybe n id Nothing == n - - trace "isJust should return the appropriate value" - assert $ isJust (Just {}) == true - assert $ isJust Nothing == false - - trace "isNothing should return the appropriate value" - assert $ isNothing Nothing == true - assert $ isNothing (Just {}) == false - - trace "test functor laws" - checkFunctor ty - - trace "test applicative laws" - checkApplicative ty ty ty - - trace "test monad laws" - checkMonad ty - -assert :: Boolean -> QC -assert = quickCheck' 1 - -check1 :: (Number -> Boolean) -> QC -check1 = quickCheck - -check2 :: (Number -> Number -> Boolean) -> QC -check2 = quickCheck - -instance arbAToMaybeB :: (Arb (a -> b)) => Arb (a -> Maybe b) where - arb = do - f <- arb - jn <- arb - return $ \x -> if jn then Just (f x) else Nothing - -instance showAToMaybeB :: (Arb (a -> b)) => Show (a -> Maybe b) where - show _ = " Maybe b>"