aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/path/driver.cxx39
1 files changed, 35 insertions, 4 deletions
diff --git a/tests/path/driver.cxx b/tests/path/driver.cxx
index 30933ea..a0fe18d 100644
--- a/tests/path/driver.cxx
+++ b/tests/path/driver.cxx
@@ -92,12 +92,22 @@ main ()
assert (p.begin () == p.end ());
}
{
+ path p;
+ assert (p.rbegin () == p.rend ());
+ }
+ {
path p ("foo");
path::iterator i (p.begin ());
assert (i != p.end () && *i == "foo");
assert (++i == p.end ());
}
{
+ path p ("foo");
+ path::reverse_iterator i (p.rbegin ());
+ assert (i != p.rend () && *i == "foo");
+ assert (++i == p.rend ());
+ }
+ {
path p ("foo/bar");
path::iterator i (p.begin ());
assert (i != p.end () && *i == "foo");
@@ -105,6 +115,13 @@ main ()
assert (++i == p.end ());
}
{
+ path p ("foo/bar");
+ path::reverse_iterator i (p.rbegin ());
+ assert (i != p.rend () && *i == "bar");
+ assert (++i != p.rend () && *i == "foo");
+ assert (++i == p.rend ());
+ }
+ {
path p ("/foo/bar");
path::iterator i (p.begin ());
assert (i != p.end () && *i == "");
@@ -112,6 +129,14 @@ main ()
assert (++i != p.end () && *i == "bar");
assert (++i == p.end ());
}
+ {
+ path p ("/foo/bar");
+ path::reverse_iterator i (p.rbegin ());
+ assert (i != p.rend () && *i == "bar");
+ assert (++i != p.rend () && *i == "foo");
+ assert (++i != p.rend () && *i == "");
+ assert (++i == p.rend ());
+ }
#ifndef _WIN32
{
path p ("/");
@@ -119,6 +144,12 @@ main ()
assert (i != p.end () && *i == "");
assert (++i == p.end ());
}
+ {
+ path p ("/");
+ path::reverse_iterator i (p.rbegin ());
+ assert (i != p.rend () && *i == "");
+ assert (++i == p.rend ());
+ }
#endif
// iterator range construction
@@ -197,11 +228,11 @@ main ()
// comparison
//
- assert (path ("./foo") == path("./foo"));
- assert (path ("./boo") < path("./foo"));
+ assert (path ("./foo") == path ("./foo"));
+ assert (path ("./boo") < path ("./foo"));
#ifdef _WIN32
- assert (path (".\\foo") == path("./FoO"));
- assert (path (".\\boo") < path(".\\Foo"));
+ assert (path (".\\foo") == path ("./FoO"));
+ assert (path (".\\boo") < path (".\\Foo"));
#endif
// posix_string