ServerJS/Filesystem API/Join: Difference between revisions
< ServerJS | Filesystem API
Wesgarland (talk | contribs) No edit summary |
|||
| (One intermediate revision by one other user not shown) | |||
| Line 12: | Line 12: | ||
''against'': <code>join("foo", "..", "bar") == "foo/../bar"</code> | ''against'': <code>join("foo", "..", "bar") == "foo/../bar"</code> | ||
* Ash Berlin | * Ash Berlin | ||
* Daniel Friesen | |||
* Mário Valente | |||
* Wes Garland | |||
* Zachary Carter | |||
'''B''': recognizes and follows absolute paths. | '''B''': recognizes and follows absolute paths. | ||
| Line 17: | Line 21: | ||
''for'': <code>join("foo", "/bar") == "/bar"</code> (Unix) <code>join("Foo", "c:\\Bar") == "c:\\Bar"</code> (Microsoft) | ''for'': <code>join("foo", "/bar") == "/bar"</code> (Unix) <code>join("Foo", "c:\\Bar") == "c:\\Bar"</code> (Microsoft) | ||
* Kris Kowal | * Kris Kowal | ||
* Wes Garland | |||
''against'': <code>join("foo", "/bar") == "foo/bar"</code> | ''against'': <code>join("foo", "/bar") == "foo/bar"</code> | ||
* | * Mário Valente | ||
* Zachary Carter | |||
* ''Daniel Friesen (fuzzy)'' | |||
Latest revision as of 19:23, 14 July 2009
Definition
Unit Tests
Show of Hands
A: implicitly uses "normal" to normalize the result, so all empty, ".", and ".." path components are resolved if possible. This is our "normal" definition, which is distinct from "canonical" and "absolute" in that it does not consult the underlying storage or the current working directory.
for: join("foo", "..", "bar") == "bar" and join("..", "foo") == "../foo"
- Kris Kowal
against: join("foo", "..", "bar") == "foo/../bar"
- Ash Berlin
- Daniel Friesen
- Mário Valente
- Wes Garland
- Zachary Carter
B: recognizes and follows absolute paths.
for: join("foo", "/bar") == "/bar" (Unix) join("Foo", "c:\\Bar") == "c:\\Bar" (Microsoft)
- Kris Kowal
- Wes Garland
against: join("foo", "/bar") == "foo/bar"
- Mário Valente
- Zachary Carter
- Daniel Friesen (fuzzy)