Lines Matching refs:path
85 using tools::fs::path; in ATF_TEST_CASE_BODY()
87 ATF_REQUIRE_EQ(path(".").str(), "."); in ATF_TEST_CASE_BODY()
88 ATF_REQUIRE_EQ(path("..").str(), ".."); in ATF_TEST_CASE_BODY()
90 ATF_REQUIRE_EQ(path("foo").str(), "foo"); in ATF_TEST_CASE_BODY()
91 ATF_REQUIRE_EQ(path("foo/bar").str(), "foo/bar"); in ATF_TEST_CASE_BODY()
92 ATF_REQUIRE_EQ(path("foo/bar/").str(), "foo/bar"); in ATF_TEST_CASE_BODY()
94 ATF_REQUIRE_EQ(path("/foo").str(), "/foo"); in ATF_TEST_CASE_BODY()
95 ATF_REQUIRE_EQ(path("/foo/bar").str(), "/foo/bar"); in ATF_TEST_CASE_BODY()
96 ATF_REQUIRE_EQ(path("/foo/bar/").str(), "/foo/bar"); in ATF_TEST_CASE_BODY()
98 ATF_REQUIRE_EQ(path("///foo").str(), "/foo"); in ATF_TEST_CASE_BODY()
99 ATF_REQUIRE_EQ(path("///foo///bar").str(), "/foo/bar"); in ATF_TEST_CASE_BODY()
100 ATF_REQUIRE_EQ(path("///foo///bar///").str(), "/foo/bar"); in ATF_TEST_CASE_BODY()
110 using tools::fs::path; in ATF_TEST_CASE_BODY()
112 ATF_REQUIRE( path("/").is_absolute()); in ATF_TEST_CASE_BODY()
113 ATF_REQUIRE( path("////").is_absolute()); in ATF_TEST_CASE_BODY()
114 ATF_REQUIRE( path("////a").is_absolute()); in ATF_TEST_CASE_BODY()
115 ATF_REQUIRE( path("//a//").is_absolute()); in ATF_TEST_CASE_BODY()
116 ATF_REQUIRE(!path("a////").is_absolute()); in ATF_TEST_CASE_BODY()
117 ATF_REQUIRE(!path("../foo").is_absolute()); in ATF_TEST_CASE_BODY()
127 using tools::fs::path; in ATF_TEST_CASE_BODY()
129 ATF_REQUIRE( path("/").is_root()); in ATF_TEST_CASE_BODY()
130 ATF_REQUIRE( path("////").is_root()); in ATF_TEST_CASE_BODY()
131 ATF_REQUIRE(!path("////a").is_root()); in ATF_TEST_CASE_BODY()
132 ATF_REQUIRE(!path("//a//").is_root()); in ATF_TEST_CASE_BODY()
133 ATF_REQUIRE(!path("a////").is_root()); in ATF_TEST_CASE_BODY()
134 ATF_REQUIRE(!path("../foo").is_root()); in ATF_TEST_CASE_BODY()
144 using tools::fs::path; in ATF_TEST_CASE_BODY()
146 ATF_REQUIRE_EQ(path(".").branch_path().str(), "."); in ATF_TEST_CASE_BODY()
147 ATF_REQUIRE_EQ(path("foo").branch_path().str(), "."); in ATF_TEST_CASE_BODY()
148 ATF_REQUIRE_EQ(path("foo/bar").branch_path().str(), "foo"); in ATF_TEST_CASE_BODY()
149 ATF_REQUIRE_EQ(path("/foo").branch_path().str(), "/"); in ATF_TEST_CASE_BODY()
150 ATF_REQUIRE_EQ(path("/foo/bar").branch_path().str(), "/foo"); in ATF_TEST_CASE_BODY()
160 using tools::fs::path; in ATF_TEST_CASE_BODY()
162 ATF_REQUIRE_EQ(path(".").leaf_name(), "."); in ATF_TEST_CASE_BODY()
163 ATF_REQUIRE_EQ(path("foo").leaf_name(), "foo"); in ATF_TEST_CASE_BODY()
164 ATF_REQUIRE_EQ(path("foo/bar").leaf_name(), "bar"); in ATF_TEST_CASE_BODY()
165 ATF_REQUIRE_EQ(path("/foo").leaf_name(), "foo"); in ATF_TEST_CASE_BODY()
166 ATF_REQUIRE_EQ(path("/foo/bar").leaf_name(), "bar"); in ATF_TEST_CASE_BODY()
176 using tools::fs::path; in ATF_TEST_CASE_BODY()
178 ATF_REQUIRE(path("/") == path("///")); in ATF_TEST_CASE_BODY()
179 ATF_REQUIRE(path("/a") == path("///a")); in ATF_TEST_CASE_BODY()
180 ATF_REQUIRE(path("/a") == path("///a///")); in ATF_TEST_CASE_BODY()
182 ATF_REQUIRE(path("a/b/c") == path("a//b//c")); in ATF_TEST_CASE_BODY()
183 ATF_REQUIRE(path("a/b/c") == path("a//b//c///")); in ATF_TEST_CASE_BODY()
193 using tools::fs::path; in ATF_TEST_CASE_BODY()
195 ATF_REQUIRE(path("/") != path("//a/")); in ATF_TEST_CASE_BODY()
196 ATF_REQUIRE(path("/a") != path("a///")); in ATF_TEST_CASE_BODY()
198 ATF_REQUIRE(path("a/b/c") != path("a/b")); in ATF_TEST_CASE_BODY()
199 ATF_REQUIRE(path("a/b/c") != path("a//b")); in ATF_TEST_CASE_BODY()
200 ATF_REQUIRE(path("a/b/c") != path("/a/b/c")); in ATF_TEST_CASE_BODY()
201 ATF_REQUIRE(path("a/b/c") != path("/a//b//c")); in ATF_TEST_CASE_BODY()
211 using tools::fs::path; in ATF_TEST_CASE_BODY()
213 ATF_REQUIRE_EQ((path("foo") / "bar").str(), "foo/bar"); in ATF_TEST_CASE_BODY()
214 ATF_REQUIRE_EQ((path("foo/") / "/bar").str(), "foo/bar"); in ATF_TEST_CASE_BODY()
215 ATF_REQUIRE_EQ((path("foo/") / "/bar/baz").str(), "foo/bar/baz"); in ATF_TEST_CASE_BODY()
216 ATF_REQUIRE_EQ((path("foo/") / "///bar///baz").str(), "foo/bar/baz"); in ATF_TEST_CASE_BODY()
228 using tools::fs::path; in ATF_TEST_CASE_BODY()
233 const path p("."); in ATF_TEST_CASE_BODY()
234 path pa = p.to_absolute(); in ATF_TEST_CASE_BODY()
244 const path p("files/reg"); in ATF_TEST_CASE_BODY()
245 path pa = p.to_absolute(); in ATF_TEST_CASE_BODY()
262 using tools::fs::path; in ATF_TEST_CASE_BODY()
266 ATF_REQUIRE(!(path("aaa") < path("aaa"))); in ATF_TEST_CASE_BODY()
268 ATF_REQUIRE( path("aab") < path("abc")); in ATF_TEST_CASE_BODY()
269 ATF_REQUIRE(!(path("abc") < path("aab"))); in ATF_TEST_CASE_BODY()
285 using tools::fs::path; in ATF_TEST_CASE_BODY()
289 directory d(path("files")); in ATF_TEST_CASE_BODY()
307 using tools::fs::path; in ATF_TEST_CASE_BODY()
311 directory d(path("files")); in ATF_TEST_CASE_BODY()
336 using tools::fs::path; in ATF_TEST_CASE_BODY()
340 directory d(path("files")); in ATF_TEST_CASE_BODY()
361 using tools::fs::path; in ATF_TEST_CASE_BODY()
366 path p("files/dir"); in ATF_TEST_CASE_BODY()
372 path p("files/reg"); in ATF_TEST_CASE_BODY()
387 using tools::fs::path; in ATF_TEST_CASE_BODY()
389 path p("file"); in ATF_TEST_CASE_BODY()
461 tools::fs::path t1("non-existent"); in ATF_TEST_CASE_BODY()
462 tools::fs::path t2("non-existent"); in ATF_TEST_CASE_BODY()
465 tools::fs::path tmpl("testdir.XXXXXX"); in ATF_TEST_CASE_BODY()
519 using tools::fs::path; in ATF_TEST_CASE_BODY()
523 ATF_REQUIRE( exists(path("files"))); in ATF_TEST_CASE_BODY()
524 ATF_REQUIRE(!exists(path("file"))); in ATF_TEST_CASE_BODY()
525 ATF_REQUIRE(!exists(path("files2"))); in ATF_TEST_CASE_BODY()
527 ATF_REQUIRE( exists(path("files/."))); in ATF_TEST_CASE_BODY()
528 ATF_REQUIRE( exists(path("files/.."))); in ATF_TEST_CASE_BODY()
529 ATF_REQUIRE( exists(path("files/dir"))); in ATF_TEST_CASE_BODY()
530 ATF_REQUIRE( exists(path("files/reg"))); in ATF_TEST_CASE_BODY()
531 ATF_REQUIRE(!exists(path("files/foo"))); in ATF_TEST_CASE_BODY()
542 using tools::fs::path; in ATF_TEST_CASE_BODY()
546 ATF_REQUIRE( is_executable(path("files"))); in ATF_TEST_CASE_BODY()
547 ATF_REQUIRE( is_executable(path("files/."))); in ATF_TEST_CASE_BODY()
548 ATF_REQUIRE( is_executable(path("files/.."))); in ATF_TEST_CASE_BODY()
549 ATF_REQUIRE( is_executable(path("files/dir"))); in ATF_TEST_CASE_BODY()
551 ATF_REQUIRE(!is_executable(path("non-existent"))); in ATF_TEST_CASE_BODY()
553 ATF_REQUIRE(!is_executable(path("files/reg"))); in ATF_TEST_CASE_BODY()
555 ATF_REQUIRE( is_executable(path("files/reg"))); in ATF_TEST_CASE_BODY()
566 using tools::fs::path; in ATF_TEST_CASE_BODY()
571 ATF_REQUIRE( exists(path("files/reg"))); in ATF_TEST_CASE_BODY()
572 remove(path("files/reg")); in ATF_TEST_CASE_BODY()
573 ATF_REQUIRE(!exists(path("files/reg"))); in ATF_TEST_CASE_BODY()
575 ATF_REQUIRE( exists(path("files/dir"))); in ATF_TEST_CASE_BODY()
576 ATF_REQUIRE_THROW(tools::system_error, remove(path("files/dir"))); in ATF_TEST_CASE_BODY()
577 ATF_REQUIRE( exists(path("files/dir"))); in ATF_TEST_CASE_BODY()
595 tools::fs::path p("root"); in ATF_TEST_CASE_BODY()
619 cleanup(tools::fs::path("aux/root")); in ATF_TEST_CASE_BODY()
643 const tools::fs::path p("root"); in ATF_TEST_CASE_BODY()
662 const tools::fs::path old = get_current_dir(); in ATF_TEST_CASE_BODY()
665 change_directory(tools::fs::path("files/reg"))); in ATF_TEST_CASE_BODY()
668 tools::fs::path old2 = change_directory(tools::fs::path("files")); in ATF_TEST_CASE_BODY()
670 tools::fs::path old3 = change_directory(tools::fs::path("dir")); in ATF_TEST_CASE_BODY()
672 tools::fs::path old4 = change_directory(tools::fs::path("../..")); in ATF_TEST_CASE_BODY()
691 tools::fs::path curdir = get_current_dir(); in ATF_TEST_CASE_BODY()
692 change_directory(tools::fs::path(".")); in ATF_TEST_CASE_BODY()
694 change_directory(tools::fs::path("files")); in ATF_TEST_CASE_BODY()
696 change_directory(tools::fs::path("dir")); in ATF_TEST_CASE_BODY()
698 change_directory(tools::fs::path("..")); in ATF_TEST_CASE_BODY()
700 change_directory(tools::fs::path("..")); in ATF_TEST_CASE_BODY()