| 743 | // a decomposition function. |
| 744 | |
| 745 | void query_and_decomposition_tests() |
| 746 | { |
| 747 | std::cout << "query_and_decomposition_tests..." << std::endl; |
| 748 | |
| 749 | // stem() tests not otherwise covered |
| 750 | BOOST_TEST(path("b").stem() == "b"); |
| 751 | BOOST_TEST(path("a/b.txt").stem() == "b"); |
| 752 | BOOST_TEST(path("a/b.").stem() == "b"); |
| 753 | BOOST_TEST(path("a.b.c").stem() == "a.b"); |
| 754 | BOOST_TEST(path("a.b.c.").stem() == "a.b.c"); |
| 755 | |
| 756 | // extension() tests not otherwise covered |
| 757 | BOOST_TEST(path("a/b").extension() == ""); |
| 758 | BOOST_TEST(path("a.b/c").extension() == ""); |
| 759 | BOOST_TEST(path("a/b.txt").extension() == ".txt"); |
| 760 | BOOST_TEST(path("a/b.").extension() == "."); |
| 761 | BOOST_TEST(path("a.b.c").extension() == ".c"); |
| 762 | BOOST_TEST(path("a.b.c.").extension() == "."); |
| 763 | BOOST_TEST(path("a/").extension() == ""); |
| 764 | |
| 765 | // main q & d test sequence |
| 766 | path p; |
| 767 | path q; |
| 768 | |
| 769 | p = q = ""; |
| 770 | BOOST_TEST(p.relative_path().string() == ""); |
| 771 | BOOST_TEST(p.parent_path().string() == ""); |
| 772 | PATH_TEST_EQ(q.remove_filename().string(), p.parent_path().string()); |
| 773 | BOOST_TEST(p.filename() == ""); |
| 774 | BOOST_TEST(p.stem() == ""); |
| 775 | BOOST_TEST(p.extension() == ""); |
| 776 | BOOST_TEST(p.root_name() == ""); |
| 777 | BOOST_TEST(p.root_directory() == ""); |
| 778 | BOOST_TEST(p.root_path().string() == ""); |
| 779 | BOOST_TEST(!p.has_root_path()); |
| 780 | BOOST_TEST(!p.has_root_name()); |
| 781 | BOOST_TEST(!p.has_root_directory()); |
| 782 | BOOST_TEST(!p.has_relative_path()); |
| 783 | BOOST_TEST(!p.has_filename()); |
| 784 | BOOST_TEST(!p.has_stem()); |
| 785 | BOOST_TEST(!p.has_extension()); |
| 786 | BOOST_TEST(!p.has_parent_path()); |
| 787 | BOOST_TEST(!p.is_absolute()); |
| 788 | |
| 789 | p = q = "/"; |
| 790 | BOOST_TEST(p.relative_path().string() == ""); |
| 791 | BOOST_TEST(p.parent_path().string() == ""); |
| 792 | PATH_TEST_EQ(q.remove_filename().string(), p.parent_path().string()); |
| 793 | BOOST_TEST(p.filename() == "/"); |
| 794 | BOOST_TEST(p.stem() == "/"); |
| 795 | BOOST_TEST(p.extension() == ""); |
| 796 | BOOST_TEST(p.root_name() == ""); |
| 797 | BOOST_TEST(p.root_directory() == "/"); |
| 798 | BOOST_TEST(p.root_path().string() == "/"); |
| 799 | BOOST_TEST(p.has_root_path()); |
| 800 | BOOST_TEST(!p.has_root_name()); |
| 801 | BOOST_TEST(p.has_root_directory()); |
| 802 | BOOST_TEST(!p.has_relative_path()); |
no test coverage detected