summaryrefslogtreecommitdiff
path: root/test/libcxx/experimental/filesystem/class.path/path.member/path.append.pass.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-01-02 19:18:58 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-01-02 19:18:58 +0000
commit53a420fba21cf1644972b34dcd811a43cdb8368d (patch)
tree66a19f6f8b65215772549a51d688492ab8addc0d /test/libcxx/experimental/filesystem/class.path/path.member/path.append.pass.cpp
parentb50f1549701eb950921e5d6f2e55ba1a1dadbb43 (diff)
Notes
Diffstat (limited to 'test/libcxx/experimental/filesystem/class.path/path.member/path.append.pass.cpp')
-rw-r--r--test/libcxx/experimental/filesystem/class.path/path.member/path.append.pass.cpp70
1 files changed, 70 insertions, 0 deletions
diff --git a/test/libcxx/experimental/filesystem/class.path/path.member/path.append.pass.cpp b/test/libcxx/experimental/filesystem/class.path/path.member/path.append.pass.cpp
new file mode 100644
index 000000000000..c43ea078f989
--- /dev/null
+++ b/test/libcxx/experimental/filesystem/class.path/path.member/path.append.pass.cpp
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <experimental/filesystem>
+
+// class path
+
+// path& operator/=(path const&)
+// path operator/(path const&, path const&)
+
+
+#define _LIBCPP_DEBUG 0
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : (void)::AssertCount++)
+int AssertCount = 0;
+
+#include <experimental/filesystem>
+#include <type_traits>
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "test_iterators.h"
+#include "count_new.hpp"
+#include "filesystem_test_helper.hpp"
+
+namespace fs = std::experimental::filesystem;
+
+int main()
+{
+ using namespace fs;
+ {
+ path lhs("//foo");
+ path rhs("/bar");
+ assert(AssertCount == 0);
+ lhs /= rhs;
+ assert(AssertCount == 0);
+ }
+ {
+ path lhs("//foo");
+ path rhs("/bar");
+ assert(AssertCount == 0);
+ (void)(lhs / rhs);
+ assert(AssertCount == 0);
+ }
+ {
+ path lhs("//foo");
+ path rhs("//bar");
+ assert(AssertCount == 0);
+ lhs /= rhs;
+ assert(AssertCount == 1);
+ AssertCount = 0;
+ }
+ {
+ path lhs("//foo");
+ path rhs("//bar");
+ assert(AssertCount == 0);
+ (void)(lhs / rhs);
+ assert(AssertCount == 1);
+ }
+ // FIXME The same error is not diagnosed for the append(Source) and
+ // append(It, It) overloads.
+}