56 simplifiedPermissionAccess();
62 simplifiedPermissionAccess()
65 fs::path f = temp.makeFile(
"Lumiera.nix");
66 CHECK (fs::exists(f));
67 CHECK (f.filename() ==
"Lumiera.nix");
68 CHECK (f.parent_path() == temp);
71 fs::permissions(f, fs::perms::owner_read | fs::perms::group_all | fs::perms::others_exec);
73 CHECK ( fs::has_perm(f, fs::perms::owner_read));
74 CHECK (not fs::has_perm(f, fs::perms::owner_write));
75 CHECK (not fs::has_perm(f, fs::perms::owner_exec));
76 CHECK (not fs::has_perm(f, fs::perms::owner_all));
77 CHECK ( fs::has_perm(f, fs::perms::group_read));
78 CHECK ( fs::has_perm(f, fs::perms::group_write));
79 CHECK ( fs::has_perm(f, fs::perms::group_exec));
80 CHECK ( fs::has_perm(f, fs::perms::group_all));
81 CHECK (not fs::has_perm(f, fs::perms::others_read));
82 CHECK (not fs::has_perm(f, fs::perms::others_write));
83 CHECK ( fs::has_perm(f, fs::perms::others_exec));
84 CHECK (not fs::has_perm(f, fs::perms::others_all));
85 CHECK (not fs::has_perm(f, fs::perms::all));
86 CHECK ( fs::can_read(f));
87 CHECK (not fs::can_write(f));
88 CHECK (not fs::can_exec(f));
94 CHECK (not out.good());
95 CHECK (0 == fs::file_size(f));
107 fs::path sweetHome{
"~"};
108 CHECK (
"~" == sweetHome.generic_string());
109 CHECK (not sweetHome.empty());
110 CHECK (not sweetHome.has_parent_path());
111 CHECK (not sweetHome.is_absolute());
113 sweetHome = fs::consolidated (sweetHome);
114 CHECK (not util::startsWith (sweetHome.generic_string(),
"~"));
115 CHECK ( util::startsWith (sweetHome.generic_string(),
"/"));
116 CHECK (not sweetHome.empty());
117 CHECK ( sweetHome.has_parent_path());
118 CHECK ( sweetHome.is_absolute());
119 CHECK (fs::is_directory(sweetHome));
121 fs::path itFollows = fs::consolidated (
"~/it/follows");
122 CHECK (util::startsWith (itFollows.generic_string(),
"/"));
123 CHECK (util::endsWith (itFollows.generic_string(),
"follows"));
124 CHECK (itFollows.filename() ==
"follows");
125 CHECK (itFollows.is_absolute());
127 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.
Simple test class runner.
A collection of frequently used helper functions to support unit testing.
A RAII style temporary directory.
void homedirectoryExpansion()