File: system_normalize_path_test.cpp

package info (click to toggle)
pingus 0.7.6-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 31,672 kB
  • sloc: cpp: 42,080; xml: 2,319; lisp: 521; ruby: 455; ansic: 365; objc: 248; sh: 247; makefile: 140; python: 15
file content (23 lines) | stat: -rw-r--r-- 694 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <assert.h>

#include "util/system.hpp"

int main(int argc, char** argv)
{
  assert(System::normalize_path("") == "");
  assert(System::normalize_path("/") == "/");
  assert(System::normalize_path("abc") == "abc");

  assert(System::normalize_path("/abc") == "/abc");
  assert(System::normalize_path("/../..") == "/");
  assert(System::normalize_path("a/../..") == "..");
  assert(System::normalize_path("a////c") == "a/c");
  assert(System::normalize_path("a//..///c") == "c");
  assert(System::normalize_path("/a//..///c") == "/c");
  assert(System::normalize_path("/a/../../b/c") == "/b/c");
  assert(System::normalize_path("../foo/bar/") == "../foo/bar");

  return 0;
}

/* EOF */