Skip to content

Commit 2a1fe66

Browse files
committed
Restore tests
1 parent bc1e8a4 commit 2a1fe66

File tree

6 files changed

+38
-34
lines changed

6 files changed

+38
-34
lines changed

bower.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,8 @@
1818
"bower.json",
1919
"gulpfile.js",
2020
"package.json"
21-
]
21+
],
22+
"devDependencies": {
23+
"purescript-assert": "^0.1.0"
24+
}
2225
}

gulpfile.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ var jshint = require("gulp-jshint");
66
var jscs = require("gulp-jscs");
77
var plumber = require("gulp-plumber");
88
var purescript = require("gulp-purescript");
9+
var run = require("gulp-run");
910
var rimraf = require("rimraf");
1011

1112
var sources = [
@@ -57,4 +58,11 @@ gulp.task("dotpsci", function () {
5758
.pipe(purescript.dotPsci());
5859
});
5960

60-
gulp.task("default", ["make", "docs", "dotpsci"]);
61+
gulp.task("test", ["make"], function() {
62+
return gulp.src(sources.concat(["test/**/*.purs"]))
63+
.pipe(plumber())
64+
.pipe(purescript.psc({ main: "Test.Main", ffi: foreigns }))
65+
.pipe(run("node"));
66+
});
67+
68+
gulp.task("default", ["make", "docs", "dotpsci", "test"]);

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"gulp-jshint": "^1.10.0",
77
"gulp-plumber": "^1.0.0",
88
"gulp-purescript": "^0.5.0-rc.1",
9+
"gulp-run": "~1.6.7",
910
"rimraf": "^2.3.3"
1011
}
1112
}

src/Node/Path.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ exports.relative = function (from) {
2222
};
2323
};
2424

25-
exports.dirname = function (path) {
26-
return path.normalize(path.dirname(path));
25+
exports.dirname = function (p) {
26+
return path.normalize(path.dirname(p));
2727
};
2828

2929
exports.basename = path.basename;
3030

31-
exports.basenameWithoutExt = function (path) {
31+
exports.basenameWithoutExt = function (p) {
3232
return function (ext) {
33-
return path.basename(path, ext);
33+
return path.basename(p, ext);
3434
};
3535
};
3636

test/Test/Main.purs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module Test.Main where
2+
3+
import Prelude
4+
import Node.Path
5+
import Test.Assert
6+
7+
main = do
8+
assert $ normalize "/foo/bar//baz/asdf/quux/.." == normalize "/foo/bar/baz/asdf"
9+
assert $ concat ["/foo", "bar"] == normalize "/foo/bar"
10+
assert $ relative "/data/orandea/test/aaa" "/data/orandea/impl/bbb" == normalize "../../impl/bbb"
11+
assert $ dirname "/foo/bar/baz/asdf/quux" == normalize "/foo/bar/baz/asdf"
12+
assert $ basename "/foo/bar/baz/asdf/quux.html" == "quux.html"
13+
assert $ basenameWithoutExt "/foo/bar/baz/asdf/quux.html" ".html" == "quux"
14+
assert $ basenameWithoutExt "/foo/bar/baz/asdf/quux.txt" ".html" == "quux.txt"
15+
assert $ extname "index.html" == ".html"
16+
assert $ extname "index.coffee.md" == ".md"
17+
assert $ extname "index." == "."
18+
assert $ extname "index" == ""
19+
assert $ sep == normalize "/"
20+
assert $ delimiter == ";" || delimiter == ":"

tests/Simple.purs

-28
This file was deleted.

0 commit comments

Comments
 (0)