path.factory.pass.cpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. //===----------------------------------------------------------------------===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is dual licensed under the MIT and the University of Illinois Open
  6. // Source Licenses. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. // UNSUPPORTED: c++98, c++03
  10. // <experimental/filesystem>
  11. // template <class Source>
  12. // path u8path(Source const&);
  13. // template <class InputIter>
  14. // path u8path(InputIter, InputIter);
  15. #include "filesystem_include.hpp"
  16. #include <type_traits>
  17. #include <cassert>
  18. #include "test_macros.h"
  19. #include "test_iterators.h"
  20. #include "count_new.hpp"
  21. #include "filesystem_test_helper.hpp"
  22. int main()
  23. {
  24. using namespace fs;
  25. const char* In1 = "abcd/efg";
  26. const std::string In2(In1);
  27. const auto In3 = In2.begin();
  28. const auto In3End = In2.end();
  29. {
  30. path p = fs::u8path(In1);
  31. assert(p == In1);
  32. }
  33. {
  34. path p = fs::u8path(In2);
  35. assert(p == In1);
  36. }
  37. {
  38. path p = fs::u8path(In3);
  39. assert(p == In1);
  40. }
  41. {
  42. path p = fs::u8path(In3, In3End);
  43. assert(p == In1);
  44. }
  45. }