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