path.factory.pass.cpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. // template <class Source>
  11. // path u8path(Source const&);
  12. // template <class InputIter>
  13. // path u8path(InputIter, InputIter);
  14. #include "filesystem_include.hpp"
  15. #include <type_traits>
  16. #include <cassert>
  17. #include "test_macros.h"
  18. #include "test_iterators.h"
  19. #include "count_new.hpp"
  20. #include "filesystem_test_helper.hpp"
  21. int main(int, char**)
  22. {
  23. using namespace fs;
  24. const char* In1 = "abcd/efg";
  25. const std::string In2(In1);
  26. const auto In3 = In2.begin();
  27. const auto In3End = In2.end();
  28. {
  29. path p = fs::u8path(In1);
  30. assert(p == In1);
  31. }
  32. {
  33. path p = fs::u8path(In2);
  34. assert(p == In1);
  35. }
  36. {
  37. path p = fs::u8path(In3);
  38. assert(p == In1);
  39. }
  40. {
  41. path p = fs::u8path(In3, In3End);
  42. assert(p == In1);
  43. }
  44. return 0;
  45. }