aboutsummaryrefslogtreecommitdiff
path: root/unittests/Support/Path.cpp
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2010-12-01 03:18:33 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2010-12-01 03:18:33 +0000
commit34ab1f6087bc0da1df0e3a73ac99762ef070d419 (patch)
treee36ef5418584577500d15fbc6c5bca49836218e5 /unittests/Support/Path.cpp
parenta9793559942dd055d460f8e3d438b49889eb4f5c (diff)
Support/PathV2: Add stem implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120547 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Support/Path.cpp')
-rw-r--r--unittests/Support/Path.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/unittests/Support/Path.cpp b/unittests/Support/Path.cpp
index 0dae960f48..70cf213f19 100644
--- a/unittests/Support/Path.cpp
+++ b/unittests/Support/Path.cpp
@@ -97,6 +97,9 @@ TEST(Support, Path) {
if (error_code ec = sys::path::filename(*i, res))
ASSERT_FALSE(ec.message().c_str());
outs() << " filename: " << res << '\n';
+ if (error_code ec = sys::path::stem(*i, res))
+ ASSERT_FALSE(ec.message().c_str());
+ outs() << " stem: " << res << '\n';
temp_store = *i;
if (error_code ec = sys::path::make_absolute(temp_store))
@@ -110,6 +113,10 @@ TEST(Support, Path) {
if (error_code ec = sys::path::replace_extension(temp_store, "ext"))
ASSERT_FALSE(ec.message().c_str());
outs() << " replace_extension: " << temp_store << '\n';
+ if (error_code ec = sys::path::stem(
+ StringRef(temp_store.begin(), temp_store.size()), res))
+ ASSERT_FALSE(ec.message().c_str());
+ outs() << " stem: " << res << '\n';
if (error_code ec = sys::path::native(*i, temp_store))
ASSERT_FALSE(ec.message().c_str());
outs() << " native: " << temp_store << '\n';