Skip to content

Commit bf6dc34

Browse files
committed
Include effect dependency
1 parent 6347a16 commit bf6dc34

File tree

2 files changed

+25
-69
lines changed

2 files changed

+25
-69
lines changed

bower.json

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
"gulpfile.js",
2020
"package.json"
2121
],
22+
"dependencies": {
23+
"purescript-effect": "^2.0.0"
24+
},
2225
"devDependencies": {
2326
"purescript-assert": "^4.0.0",
2427
"purescript-console": "^4.1.0"

test/Test/Main.purs

+22-69
Original file line numberDiff line numberDiff line change
@@ -3,79 +3,32 @@ module Test.Main where
33
import Prelude
44

55
import Effect (Effect)
6-
import Node.Path (basename, basenameWithoutExt, concat, delimiter, dirname, extname, normalize, parse, relative, sep)
6+
import Node.Path (basename, basenameWithoutExt, concat, delimiter, dirname, extname, normalize, parse, relative, resolve, sep)
77
import Test.Assert (assert, assertEqual)
88

99
main :: Effect Unit
1010
main = do
11-
assertEqual
12-
{ actual: normalize "/foo/bar//baz/asdf/quux/.."
13-
, expected: normalize "/foo/bar/baz/asdf"
14-
}
15-
assertEqual
16-
{ actual: concat ["/foo", "bar"]
17-
, expected: normalize "/foo/bar"
18-
}
19-
assertEqual
20-
{ actual: relative "/data/orandea/test/aaa" "/data/orandea/impl/bbb"
21-
, expected: normalize "../../impl/bbb"
22-
}
23-
assertEqual
24-
{ actual: dirname "/foo/bar/baz/asdf/quux"
25-
, expected: normalize "/foo/bar/baz/asdf"
26-
}
27-
assertEqual
28-
{ actual: basename "/foo/bar/baz/asdf/quux.html"
29-
, expected: "quux.html"
30-
}
31-
assertEqual
32-
{ actual: basenameWithoutExt "/foo/bar/baz/asdf/quux.html" ".html"
33-
, expected: "quux"
34-
}
35-
assertEqual
36-
{ actual: basenameWithoutExt "/foo/bar/baz/asdf/quux.txt" ".html"
37-
, expected: "quux.txt"
38-
}
39-
assertEqual
40-
{ actual: extname "index.html"
41-
, expected: ".html"
42-
}
43-
assertEqual
44-
{ actual: extname "index.coffee.md"
45-
, expected: ".md"
46-
}
47-
assertEqual
48-
{ actual: extname "index."
49-
, expected: "."
50-
}
51-
assertEqual
52-
{ actual: extname "index"
53-
, expected: ""
54-
}
55-
assertEqual
56-
{ actual: sep
57-
, expected: normalize "/"
58-
}
11+
assertEqual { actual: normalize "/foo/bar//baz/asdf/quux/..", expected: normalize "/foo/bar/baz/asdf" }
12+
assertEqual { actual: concat ["/foo", "bar"], expected: normalize "/foo/bar" }
13+
assertEqual { actual: relative "/data/orandea/test/aaa" "/data/orandea/impl/bbb", expected: normalize "../../impl/bbb" }
14+
assertEqual { actual: dirname "/foo/bar/baz/asdf/quux", expected: normalize "/foo/bar/baz/asdf" }
15+
assertEqual { actual: basename "/foo/bar/baz/asdf/quux.html", expected: "quux.html" }
16+
assertEqual { actual: basenameWithoutExt "/foo/bar/baz/asdf/quux.html" ".html", expected: "quux" }
17+
assertEqual { actual: basenameWithoutExt "/foo/bar/baz/asdf/quux.txt" ".html", expected: "quux.txt" }
18+
assertEqual { actual: extname "index.html", expected: ".html" }
19+
assertEqual { actual: extname "index.coffee.md", expected: ".md" }
20+
assertEqual { actual: extname "index.", expected: "." }
21+
assertEqual { actual: extname "index", expected: "" }
22+
assertEqual { actual: sep, expected: normalize "/" }
5923
assert $ delimiter == ";" || delimiter == ":"
6024

6125
let path = parse "/home/user/file.js"
62-
assertEqual
63-
{ actual: path.root
64-
, expected: "/"
65-
}
66-
assertEqual
67-
{ actual: path.dir
68-
, expected: "/home/user"
69-
}
70-
assertEqual
71-
{ actual: path.base
72-
, expected: "file.js"
73-
}
74-
assertEqual
75-
{ actual: path.ext
76-
, expected: ".js"
77-
}
78-
assertEqual
79-
{ actual: path.name
80-
, expected: "file"
81-
}
26+
assertEqual { actual: path.root, expected: "/" }
27+
assertEqual { actual: path.dir, expected: "/home/user" }
28+
assertEqual { actual: path.base, expected: "file.js" }
29+
assertEqual { actual: path.ext, expected: ".js" }
30+
assertEqual { actual: path.name, expected: "file" }
31+
32+
path1 <- resolve ["a"] ""
33+
path2 <- resolve ["a"] "."
34+
assertEqual { actual: path1, expected: path2 }

0 commit comments

Comments
 (0)