diff options
author | Eric Fiselier <eric@efcs.ca> | 2016-07-23 03:10:56 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2016-07-23 03:10:56 +0000 |
commit | 0fdab5eb69ca4b2e9048526b33948af72976c7bc (patch) | |
tree | f46bce4590d4f9abf9281f6e0998bc8cbb6e57f8 /libcxx/test/std/experimental/filesystem/class.path/path.member/path.append.pass.cpp | |
parent | 796331c026a6cd33624c0f22e4e289fc89093b43 (diff) | |
download | bcm5719-llvm-0fdab5eb69ca4b2e9048526b33948af72976c7bc.tar.gz bcm5719-llvm-0fdab5eb69ca4b2e9048526b33948af72976c7bc.zip |
Implement P0392r0. Integrate filesystem::path and string_view.
llvm-svn: 276511
Diffstat (limited to 'libcxx/test/std/experimental/filesystem/class.path/path.member/path.append.pass.cpp')
-rw-r--r-- | libcxx/test/std/experimental/filesystem/class.path/path.member/path.append.pass.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/libcxx/test/std/experimental/filesystem/class.path/path.member/path.append.pass.cpp b/libcxx/test/std/experimental/filesystem/class.path/path.member/path.append.pass.cpp index 1118497e06a..93892fbe10e 100644 --- a/libcxx/test/std/experimental/filesystem/class.path/path.member/path.append.pass.cpp +++ b/libcxx/test/std/experimental/filesystem/class.path/path.member/path.append.pass.cpp @@ -24,6 +24,7 @@ #include <experimental/filesystem> #include <type_traits> +#include <string_view> #include <cassert> #include "test_macros.h" @@ -77,6 +78,7 @@ void doAppendSourceAllocTest(AppendOperatorTestcase const& TC) using namespace fs; using Ptr = CharT const*; using Str = std::basic_string<CharT>; + using StrView = std::basic_string_view<CharT>; using InputIter = input_iterator<Ptr>; const Ptr L = TC.lhs; @@ -99,6 +101,16 @@ void doAppendSourceAllocTest(AppendOperatorTestcase const& TC) } assert(LHS == E); } + // basic_string_view + { + path LHS(L); PathReserve(LHS, ReserveSize); + StrView RHS(R); + { + DisableAllocationGuard g; + LHS /= RHS; + } + assert(LHS == E); + } // CharT* { path LHS(L); PathReserve(LHS, ReserveSize); @@ -153,6 +165,7 @@ void doAppendSourceTest(AppendOperatorTestcase const& TC) using namespace fs; using Ptr = CharT const*; using Str = std::basic_string<CharT>; + using StrView = std::basic_string_view<CharT>; using InputIter = input_iterator<Ptr>; const Ptr L = TC.lhs; const Ptr R = TC.rhs; @@ -172,6 +185,21 @@ void doAppendSourceTest(AppendOperatorTestcase const& TC) assert(LHS == E); assert(&Ref == &LHS); } + // basic_string_view + { + path LHS(L); + StrView RHS(R); + path& Ref = (LHS /= RHS); + assert(LHS == E); + assert(&Ref == &LHS); + } + { + path LHS(L); + StrView RHS(R); + path& Ref = LHS.append(RHS); + assert(LHS == E); + assert(&Ref == &LHS); + } // Char* { path LHS(L); |