| 2660 | // generic_path_tests --------------------------------------------------------------// |
| 2661 | |
| 2662 | void generic_path_tests() |
| 2663 | { |
| 2664 | std::cout << "generic_path_tests..." << std::endl; |
| 2665 | |
| 2666 | BOOST_TEST_EQ(path("").generic_path().string(), std::string("")); |
| 2667 | BOOST_TEST_EQ(path("/").generic_path().string(), std::string("/")); |
| 2668 | BOOST_TEST_EQ(path("//").generic_path().string(), std::string("//")); |
| 2669 | BOOST_TEST_EQ(path("///").generic_path().string(), std::string("/")); |
| 2670 | |
| 2671 | BOOST_TEST_EQ(path("foo").generic_path().string(), std::string("foo")); |
| 2672 | BOOST_TEST_EQ(path("foo/bar").generic_path().string(), std::string("foo/bar")); |
| 2673 | BOOST_TEST_EQ(path("..").generic_path().string(), std::string("..")); |
| 2674 | BOOST_TEST_EQ(path("../..").generic_path().string(), std::string("../..")); |
| 2675 | BOOST_TEST_EQ(path("/..").generic_path().string(), std::string("/..")); |
| 2676 | BOOST_TEST_EQ(path("../foo").generic_path().string(), std::string("../foo")); |
| 2677 | BOOST_TEST_EQ(path("foo/..").generic_path().string(), std::string("foo/..")); |
| 2678 | BOOST_TEST_EQ(path("foo/../").generic_path().string(), std::string("foo/../")); |
| 2679 | |
| 2680 | BOOST_TEST_EQ(path("foo//bar").generic_path().string(), std::string("foo/bar")); |
| 2681 | |
| 2682 | BOOST_TEST_EQ(path("//net//foo//bar").generic_path().string(), std::string("//net/foo/bar")); |
| 2683 | |
| 2684 | if (platform == "Windows") |
| 2685 | { |
| 2686 | BOOST_TEST_EQ(path("c:\\foo\\bar").generic_path().string(), std::string("c:/foo/bar")); |
| 2687 | BOOST_TEST_EQ(path("c:\\\\foo\\\\bar//zoo").generic_path().string(), std::string("c:/foo/bar/zoo")); |
| 2688 | |
| 2689 | BOOST_TEST_EQ(path("c:foo\\\\bar//zoo").generic_path().string(), std::string("c:foo/bar/zoo")); |
| 2690 | |
| 2691 | #if BOOST_FILESYSTEM_VERSION == 3 |
| 2692 | BOOST_TEST_EQ(path("\\\\net\\foo\\bar").generic_path().string(), std::string("//net/foo/bar")); |
| 2693 | BOOST_TEST_EQ(path("\\\\net\\\\foo\\/bar//zoo").generic_path().string(), std::string("//net/foo/bar/zoo")); |
| 2694 | |
| 2695 | BOOST_TEST_EQ(path("\\\\?\\c:\\\\foo\\\\bar//zoo").generic_path().string(), std::string("//?/c:/foo/bar/zoo")); |
| 2696 | BOOST_TEST_EQ(path("\\\\.\\c:\\\\foo\\\\bar//zoo").generic_path().string(), std::string("//./c:/foo/bar/zoo")); |
| 2697 | BOOST_TEST_EQ(path("\\??\\c:\\\\foo\\\\bar//zoo").generic_path().string(), std::string("/?" "?/c:/foo/bar/zoo")); // note: break trigraph |
| 2698 | #else |
| 2699 | BOOST_TEST_EQ(path("\\\\net\\foo\\bar").generic_path().string(), std::string("\\\\net/foo/bar")); |
| 2700 | BOOST_TEST_EQ(path("\\\\net\\\\foo\\/bar//zoo").generic_path().string(), std::string("\\\\net/foo/bar/zoo")); |
| 2701 | |
| 2702 | BOOST_TEST_EQ(path("\\\\?\\c:\\\\foo\\\\bar//zoo").generic_path().string(), std::string("\\\\?\\c:/foo/bar/zoo")); |
| 2703 | BOOST_TEST_EQ(path("\\\\.\\c:\\\\foo\\\\bar//zoo").generic_path().string(), std::string("\\\\.\\c:/foo/bar/zoo")); |
| 2704 | BOOST_TEST_EQ(path("\\??\\c:\\\\foo\\\\bar//zoo").generic_path().string(), std::string("\\??\\c:/foo/bar/zoo")); |
| 2705 | #endif |
| 2706 | } |
| 2707 | } |
| 2708 | |
| 2709 | // lexically_normal_tests ----------------------------------------------------------// |
| 2710 |
no test coverage detected