Debian Codegraph @

libcxx/test/std/input.output/filesystems/class.path/path.nonmember/append_op.pass.cpp

raw
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8
9 // UNSUPPORTED: c++03, c++11, c++14
10 // UNSUPPORTED: availability-filesystem-missing
11
12 // <filesystem>
13
14 // path operator/(path const&, path const&);
15
16 #include <filesystem>
17 #include <type_traits>
18 #include <cassert>
19
20 #include "test_macros.h"
21 namespace fs = std::filesystem;
22
23 // This is mainly tested via the member append functions.
24 int main(int, char**) {
25 using namespace fs;
26 path p1("abc");
27 path p2("def");
28 path p3 = p1 / p2;
29 assert(p3 == "abc/def");
30
31 path p4 = p1 / "def";
32 assert(p4 == "abc/def");
33
34 return 0;
35 }