git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Fix core-tests (#2162)

* Fix core-tests * test psc-docs

commit83be9a528b0276743833407666b4abcc3a15274d authorPhil Freeman <paf31@cantab.net> dateWed 25 May 2016, 10:55 (10 years ago) parentf148735
6 files changed+107−80
core-tests/.gitignore+1 core-tests/bower.json+60 core-tests/test-everything.sh+7−53 core-tests/tests/GenericDeriving.purs+30 core-tests/tests/Main.purs+9 core-tests/tests/generic-deriving/Main.purs−27
core-tests/.gitignore+1
@@ -1,2 +1,3 @@
1+core-docs.md
12bower_components/
23output/
core-tests/bower.jsonnew file+60
@@ -0,0 +1,60 @@
1+{
2+ "name": "core-tests",
3+ "homepage": "https://github.com/purescript/purescript",
4+ "authors": [
5+ "Phil Freeman <paf31@cantab.net>"
6+ ],
7+ "ignore": [
8+ "**/.*",
9+ "node_modules",
10+ "bower_components",
11+ "test",
12+ "tests"
13+ ],
14+ "dependencies": {
15+ "purescript-arrays": "#8c9ada5762",
16+ "purescript-bifunctors": "#9e3b2864ce",
17+ "purescript-console": "#db29da9aca",
18+ "purescript-const": "#cf538a65d8",
19+ "purescript-contravariant": "#9ae6d7c99c",
20+ "purescript-control": "#97096c7e26",
21+ "purescript-distributive": "#ba81c64ffd",
22+ "purescript-eff": "#dbd6c4a415",
23+ "purescript-either": "#54f4efd423",
24+ "purescript-enums": "#9332412e52",
25+ "purescript-exceptions": "#522a0cea50",
26+ "purescript-exists": "#e828c8341e",
27+ "purescript-foldable-traversable": "#df37787855",
28+ "purescript-foreign": "#64890cbbdb",
29+ "purescript-free": "#f8ab7c5f05",
30+ "purescript-functions": "#e417541936",
31+ "purescript-functor-coproducts": "#7654d9dea4",
32+ "purescript-generics": "#d09cb16ca3",
33+ "purescript-globals": "#113ee398be",
34+ "purescript-graphs": "#0b7089afa2",
35+ "purescript-identity": "#204ac5f46a",
36+ "purescript-inject": "#3ae4880bad",
37+ "purescript-integers": "#58d7605dd5",
38+ "purescript-lazy": "#bf4b34d673",
39+ "purescript-maps": "#d9e4c6599a",
40+ "purescript-math": "#99797b6494",
41+ "purescript-maybe": "#1b60a07038",
42+ "purescript-monoid": "#a8c8bb9d73",
43+ "purescript-parallel": "#c7296ab008",
44+ "purescript-prelude": "#318ee857bd",
45+ "purescript-profunctor": "#a649126cea",
46+ "purescript-proxy": "#c494b11bd7",
47+ "purescript-quickcheck": "#4a15c93f12",
48+ "purescript-random": "#68314c21e2",
49+ "purescript-refs": "#f47e1059a3",
50+ "purescript-semirings": "#c40efda15f",
51+ "purescript-sets": "#1eaabf177f",
52+ "purescript-st": "#077d9a2d7e",
53+ "purescript-strings": "#87dd5f1694",
54+ "purescript-tailrec": "#3c11db00ba",
55+ "purescript-transformers": "#2d0a471ce4",
56+ "purescript-tuples": "#4fe689ef93",
57+ "purescript-unfoldable": "#e2382f30d8",
58+ "purescript-validation": "#f43ff0fbdd"
59+ }
60+}
core-tests/test-everything.sh+7−53
@@ -1,4 +1,4 @@
1−#!/bin/bash
1+#!/usr/bin/env bash
22
33set -e
44
@@ -18,62 +18,16 @@ if [ "$force_reinstall" = "true" ] && [ -d "bower_components" ]; then
1818 rm -r bower_components
1919fi
2020
21−bower i \
22− purescript-prelude \
23− purescript-eff \
24− purescript-st \
25− purescript-integers \
26− purescript-functions \
27− purescript-console \
28− purescript-profunctor \
29− purescript-contravariant \
30− purescript-parallel \
31− purescript-control \
32− purescript-tailrec \
33− purescript-maps \
34− purescript-free \
35− purescript-transformers \
36− purescript-exists \
37− purescript-monoid \
38− purescript-either \
39− purescript-maybe \
40− purescript-inject \
41− purescript-graphs \
42− purescript-enums \
43− purescript-unfoldable \
44− purescript-coproducts \
45− purescript-lazy \
46− purescript-distributive \
47− purescript-identity \
48− purescript-bifunctors \
49− purescript-const \
50− purescript-sets \
51− purescript-quickcheck \
52− purescript-foreign \
53− purescript-foldable-traversable \
54− purescript-tuples \
55− purescript-strings \
56− purescript-arrays \
57− purescript-random \
58− purescript-refs \
59− purescript-globals \
60− purescript-exceptions \
61− purescript-validation \
62− purescript-parallel \
63− purescript-proxy \
64− purescript-semirings \
65− purescript-math \
66− purescript-generics
21+# todo : fix this once core libraries reach 1.0
22+yes 1 | bower i
6723
6824if [ "$force_recompile" = "true" ] && [ -d "output" ]; then
6925 echo "Recompiling..."
7026 rm -r output
7127fi
7228
73−../dist/build/psc/psc tests/*/*.purs \
74− 'bower_components/purescript-*/src/**/*.purs' \
75− --ffi 'bower_components/purescript-*/src/**/*.js'
29+stack exec psc 'tests/**/*.purs' 'bower_components/purescript-*/src/**/*.purs'
7630
77−../dist/build/psc-docs/psc-docs tests/*/*.purs \
78− 'bower_components/purescript-*/src/**/*.purs' \
79− > full-core-docs.md
31+stack exec psc-docs 'bower_components/purescript-*/src/**/*.purs' > core-docs.md
32+
33+NODE_PATH=output node -e "require('Test.Main').main()"
core-tests/tests/GenericDeriving.pursnew file+30
@@ -0,0 +1,30 @@
1+module Test.GenericDeriving where
2+
3+import Prelude
4+
5+import Control.Monad.Eff (Eff)
6+import Control.Monad.Eff.Console (CONSOLE, log, logShow)
7+import Data.Generic (class Generic, gShow, gEq)
8+import Partial.Unsafe (unsafePartial)
9+
10+data Empty
11+
12+derive instance genericEmpty :: Partial => Generic Empty
13+
14+data A a
15+ = A Number String
16+ | B Int
17+ | C (Array (A a))
18+ | D { "asgård" :: a }
19+ | E Empty
20+
21+derive instance genericA :: (Partial, Generic b) => Generic (A b)
22+
23+newtype X b = X b
24+
25+derive instance genericX :: Generic (X String)
26+
27+main :: forall eff. Eff (console :: CONSOLE | eff) Unit
28+main = unsafePartial do
29+ log $ gShow (D { "asgård": C [ A 1.0 "test", B 42, D { "asgård": true } ] })
30+ logShow $ gEq (C [B 0]) (C [B 0] :: A Empty)
core-tests/tests/Main.pursnew file+9
@@ -0,0 +1,9 @@
1+module Test.Main where
2+
3+import Prelude
4+import Control.Monad.Eff (Eff)
5+import Control.Monad.Eff.Console (CONSOLE)
6+import Test.GenericDeriving as GenericDeriving
7+
8+main :: forall eff. Eff (console :: CONSOLE | eff) Unit
9+main = GenericDeriving.main
core-tests/tests/generic-deriving/Main.pursdeleted−27
@@ -1,27 +0,0 @@
1−module GenericDeriving where
2−
3−import Prelude
4−
5−import Control.Monad.Eff (Eff)
6−import Control.Monad.Eff.Console (CONSOLE, log)
7−import Data.Generic
8−
9−data Void
10−
11−derive instance genericVoid :: Generic Void
12−
13−data A a
14− = A Number String
15− | B Int
16− | C (Array (A a))
17− | D { "asgård" :: a }
18− | E Void
19−
20−derive instance genericA :: (Generic b) => Generic (A b)
21−
22−newtype X b = X b
23−
24−derive instance genericX :: Generic (X String)
25−
26−main :: forall eff. Eff (console :: CONSOLE | eff) Unit
27−main = log (gShow (D { "asgård": C [ A 1.0 "test", B 42, D { "asgård": true } ] }))