append_op.pass.cpp 859 B

1234567891011121314151617181920212223242526272829303132333435
  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. // UNSUPPORTED: c++98, c++03
  9. // <filesystem>
  10. // path operator/(path const&, path const&);
  11. #include "filesystem_include.hpp"
  12. #include <type_traits>
  13. #include <cassert>
  14. #include "test_macros.h"
  15. #include "filesystem_test_helper.hpp"
  16. // This is mainly tested via the member append functions.
  17. int main(int, char**)
  18. {
  19. using namespace fs;
  20. path p1("abc");
  21. path p2("def");
  22. path p3 = p1 / p2;
  23. assert(p3 == "abc/def");
  24. path p4 = p1 / "def";
  25. assert(p4 == "abc/def");
  26. return 0;
  27. }