Home | History | Annotate | Download | only in path.nonmember
      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 
     10 // UNSUPPORTED: c++98, c++03
     11 
     12 // <experimental/filesystem>
     13 
     14 // template <class Source>
     15 //    path u8path(Source const&);
     16 // template <class InputIter>
     17 //   path u8path(InputIter, InputIter);
     18 
     19 #include <experimental/filesystem>
     20 #include <type_traits>
     21 #include <cassert>
     22 
     23 #include "test_macros.h"
     24 #include "test_iterators.h"
     25 #include "count_new.hpp"
     26 #include "filesystem_test_helper.hpp"
     27 
     28 namespace fs = std::experimental::filesystem;
     29 
     30 int main()
     31 {
     32   using namespace fs;
     33   const char* In1 = "abcd/efg";
     34   const std::string In2(In1);
     35   const auto In3 = In2.begin();
     36   const auto In3End = In2.end();
     37   {
     38     path p = fs::u8path(In1);
     39     assert(p == In1);
     40   }
     41   {
     42     path p = fs::u8path(In2);
     43     assert(p == In1);
     44   }
     45   {
     46     path p = fs::u8path(In3);
     47     assert(p == In1);
     48   }
     49   {
     50     path p = fs::u8path(In3, In3End);
     51     assert(p == In1);
     52   }
     53 }
     54