~jason2605/dictu/package

« back to all changes in this revision

Viewing changes to tests/path/realpath.du

  • Committer: jasonhall96686 at gmail
  • Date: 2021-01-04 20:33:43 UTC
  • Revision ID: jasonhall96686@gmail.com-20210104203343-ldo9uscht0ifjc0a
Tags: upstream-0.15.0
ImportĀ upstreamĀ versionĀ 0.15.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/**
2
 
 * realpath.du
3
 
 *
4
 
 * Testing Path.realpath()
5
 
 *
6
 
 * Returns the canonicalized absolute pathname or nil on error.
7
 
 */
8
 
import Path;
9
 
 
10
 
if (System.platform != "windows") {
11
 
  assert(Path.delimiter == ":");
12
 
  assert(Path.dirSeparator == "/");
13
 
  assert(Path.realpath("/usr/../usr/../usr").unwrap() == "/usr");
14
 
  assert(Path.realpath("doesnotexist/../../").success() == false);
15
 
  assert(Path.realpath("doesnotexist/../../").unwrapError() == "No such file or directory");
16
 
}