From 545cbdf063b3e31be4ef6de06c3109beba8ec714 Mon Sep 17 00:00:00 2001 From: "Michael J. Spencer" Date: Tue, 30 Nov 2010 23:28:07 +0000 Subject: Support/PathV2: Implement reverse iteration and parent_path. llvm-svn: 120496 --- llvm/unittests/Support/Path.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'llvm/unittests/Support/Path.cpp') diff --git a/llvm/unittests/Support/Path.cpp b/llvm/unittests/Support/Path.cpp index 2c7c3cba9e6..b8f818ff1db 100644 --- a/llvm/unittests/Support/Path.cpp +++ b/llvm/unittests/Support/Path.cpp @@ -71,6 +71,15 @@ TEST(Support, Path) { } outs() << "]\n"; + outs() << " Reverse Iteration: ["; + for (sys::path::reverse_iterator ci = sys::path::rbegin(*i), + ce = sys::path::rend(*i); + ci != ce; + ++ci) { + outs() << *ci << ','; + } + outs() << "]\n"; + StringRef res; SmallString<16> temp_store; if (error_code ec = sys::path::root_path(*i, res)) @@ -82,6 +91,9 @@ TEST(Support, Path) { if (error_code ec = sys::path::root_directory(*i, res)) ASSERT_FALSE(ec.message().c_str()); outs() << " root_directory: " << res << '\n'; + if (error_code ec = sys::path::parent_path(*i, res)) + ASSERT_FALSE(ec.message().c_str()); + outs() << " parent_path: " << res << '\n'; temp_store = *i; if (error_code ec = sys::path::make_absolute(temp_store)) -- cgit v1.2.3