aboutsummaryrefslogtreecommitdiff
path: root/tests/build/path
diff options
context:
space:
mode:
Diffstat (limited to 'tests/build/path')
-rw-r--r--tests/build/path/driver.cxx34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/build/path/driver.cxx b/tests/build/path/driver.cxx
index 739146b..3aa624c 100644
--- a/tests/build/path/driver.cxx
+++ b/tests/build/path/driver.cxx
@@ -77,6 +77,40 @@ main ()
assert (path ("C:\\foo.txt").base ().string () == "C:\\foo");
#endif
+ // iteration
+ //
+ {
+ path p;
+ assert (p.begin () == p.end ());
+ }
+ {
+ path p ("foo");
+ path::iterator i (p.begin ());
+ assert (i != p.end () && *i == "foo");
+ assert (++i == p.end ());
+ }
+ {
+ path p ("foo/bar");
+ path::iterator i (p.begin ());
+ assert (i != p.end () && *i == "foo");
+ assert (++i != p.end () && *i == "bar");
+ assert (++i == p.end ());
+ }
+ {
+ path p ("/foo/bar");
+ path::iterator i (p.begin ());
+ assert (i != p.end () && *i == "");
+ assert (++i != p.end () && *i == "foo");
+ assert (++i != p.end () && *i == "bar");
+ assert (++i == p.end ());
+ }
+ {
+ path p ("/");
+ path::iterator i (p.begin ());
+ assert (i != p.end () && *i == "");
+ assert (++i == p.end ());
+ }
+
// operator/
//
#ifndef _WIN32