47 simplifiedPermissionAccess();
53 simplifiedPermissionAccess()
56 fs::path f = temp.makeFile(
"Lumiera.nix");
57 CHECK (fs::exists(f));
58 CHECK (f.filename() ==
"Lumiera.nix");
59 CHECK (f.parent_path() == temp);
62 fs::permissions(f, fs::perms::owner_read | fs::perms::group_all | fs::perms::others_exec);
64 CHECK ( fs::has_perm(f, fs::perms::owner_read));
65 CHECK (not fs::has_perm(f, fs::perms::owner_write));
66 CHECK (not fs::has_perm(f, fs::perms::owner_exec));
67 CHECK (not fs::has_perm(f, fs::perms::owner_all));
68 CHECK ( fs::has_perm(f, fs::perms::group_read));
69 CHECK ( fs::has_perm(f, fs::perms::group_write));
70 CHECK ( fs::has_perm(f, fs::perms::group_exec));
71 CHECK ( fs::has_perm(f, fs::perms::group_all));
72 CHECK (not fs::has_perm(f, fs::perms::others_read));
73 CHECK (not fs::has_perm(f, fs::perms::others_write));
74 CHECK ( fs::has_perm(f, fs::perms::others_exec));
75 CHECK (not fs::has_perm(f, fs::perms::others_all));
76 CHECK (not fs::has_perm(f, fs::perms::all));
77 CHECK ( fs::can_read(f));
78 CHECK (not fs::can_write(f));
79 CHECK (not fs::can_exec(f));
85 CHECK (not out.good());
86 CHECK (0 == fs::file_size(f));
98 fs::path sweetHome{
"~"};
99 CHECK (
"~" == sweetHome.generic_string());
100 CHECK (not sweetHome.empty());
101 CHECK (not sweetHome.has_parent_path());
102 CHECK (not sweetHome.is_absolute());
104 sweetHome = fs::consolidated (sweetHome);
105 CHECK (not util::startsWith (sweetHome.generic_string(),
"~"));
106 CHECK ( util::startsWith (sweetHome.generic_string(),
"/"));
107 CHECK (not sweetHome.empty());
108 CHECK ( sweetHome.has_parent_path());
109 CHECK ( sweetHome.is_absolute());
110 CHECK (fs::is_directory(sweetHome));
112 fs::path itFollows = fs::consolidated (
"~/it/follows");
113 CHECK (util::startsWith (itFollows.generic_string(),
"/"));
114 CHECK (util::endsWith (itFollows.generic_string(),
"follows"));
115 CHECK (itFollows.filename() ==
"follows");
116 CHECK (itFollows.is_absolute());
118 CHECK (fs::relative (itFollows, sweetHome) ==
"it/follows");
Includes the C++ Filesystem library and provides some convenience helpers.
Manage a temporary directory for storage, with automated clean-up.
Implementation namespace for support and library code.
Simplistic test class runner.
A collection of frequently used helper functions to support unit testing.
A RAII style temporary directory.
void homedirectoryExpansion()