MCPcopy Create free account
hub / github.com/Kitware/CMake / testModifiers

Function testModifiers

Tests/CMakeLib/testCMFilesystemPath.cxx:194–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

192}
193
194bool testModifiers()
195{
196 std::cout << "testModifiers()";
197
198 bool result = true;
199
200 {
201 std::string s("a///b/");
202 fs::path p(s);
203 std::replace(
204 s.begin(), s.end(), '/',
205 static_cast<std::string::value_type>(fs::path::preferred_separator));
206 p.make_preferred();
207 if (p.string() != s) {
208 result = false;
209 }
210 }
211 {
212 fs::path p("a/b/c.e.f");
213 p.remove_filename();
214 if (p.string() != "a/b/") {
215 result = false;
216 }
217 p.remove_filename();
218 if (p.string() != "a/b/") {
219 result = false;
220 }
221 }
222 {
223 fs::path p("a/b/c.e.f");
224 p.replace_filename("x.y");
225 if (p.string() != "a/b/x.y") {
226 result = false;
227 }
228 }
229 {
230 fs::path p("a/b/c.e.f");
231 p.replace_extension(".x");
232 if (p.string() != "a/b/c.e.x") {
233 result = false;
234 }
235 p.replace_extension(".y");
236 if (p.string() != "a/b/c.e.y") {
237 result = false;
238 }
239 p.replace_extension();
240 if (p.string() != "a/b/c.e") {
241 result = false;
242 }
243 p = "/a/b";
244 p.replace_extension(".x");
245 if (p.string() != "/a/b.x") {
246 result = false;
247 }
248 p = "/a/b/";
249 p.replace_extension(".x");
250 if (p.string() != "/a/b/.x") {
251 result = false;

Callers

nothing calls this directly

Calls 4

checkResultFunction · 0.70
beginMethod · 0.45
endMethod · 0.45
stringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…