native.pass.cpp 943 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. // class path
  12. // const string_type& native() const noexcept;
  13. #include "filesystem_include.hpp"
  14. #include <type_traits>
  15. #include <cassert>
  16. #include "test_macros.h"
  17. #include "filesystem_test_helper.hpp"
  18. int main()
  19. {
  20. using namespace fs;
  21. const char* const value = "hello world";
  22. { // Check signature
  23. path p(value);
  24. ASSERT_SAME_TYPE(path::string_type const&, decltype(p.native()));
  25. ASSERT_NOEXCEPT(p.native());
  26. }
  27. { // native() is tested elsewhere
  28. path p(value);
  29. assert(p.native() == value);
  30. }
  31. }