| 358 | } |
| 359 | |
| 360 | bool testGeneration() |
| 361 | { |
| 362 | std::cout << "testGeneration()"; |
| 363 | |
| 364 | bool result = true; |
| 365 | |
| 366 | { |
| 367 | fs::path p("a/./b/.."); |
| 368 | if (p.lexically_normal().generic_string() != "a/") { |
| 369 | result = false; |
| 370 | } |
| 371 | p = "a/.///b/../"; |
| 372 | if (p.lexically_normal().generic_string() != "a/") { |
| 373 | result = false; |
| 374 | } |
| 375 | } |
| 376 | #if defined(_WIN32) |
| 377 | { |
| 378 | fs::path p("//host/./b/.."); |
| 379 | if (p.lexically_normal().string() != "\\\\host\\") { |
| 380 | result = false; |
| 381 | } |
| 382 | p = "//host/.///b/../"; |
| 383 | if (p.lexically_normal().string() != "\\\\host\\") { |
| 384 | result = false; |
| 385 | } |
| 386 | p = "c://a/.///b/../"; |
| 387 | if (p.lexically_normal().string() != "c:\\a\\") { |
| 388 | result = false; |
| 389 | } |
| 390 | } |
| 391 | #endif |
| 392 | |
| 393 | { |
| 394 | if (fs::path("/a//d").lexically_relative("/a/b/c") != "../../d") { |
| 395 | result = false; |
| 396 | } |
| 397 | if (fs::path("/a//b///c").lexically_relative("/a/d") != "../b/c") { |
| 398 | result = false; |
| 399 | } |
| 400 | if (fs::path("a/b/c").lexically_relative("a") != "b/c") { |
| 401 | result = false; |
| 402 | } |
| 403 | if (fs::path("a/b/c").lexically_relative("a/b/c/x/y") != "../..") { |
| 404 | result = false; |
| 405 | } |
| 406 | if (fs::path("a/b/c").lexically_relative("a/b/c") != ".") { |
| 407 | result = false; |
| 408 | } |
| 409 | if (fs::path("a/b").lexically_relative("c/d") != "../../a/b") { |
| 410 | result = false; |
| 411 | } |
| 412 | } |
| 413 | { |
| 414 | #if defined(_WIN32) |
| 415 | if (fs::path("/a/d").lexically_relative("e/d/c") != "/a/d") { |
| 416 | result = false; |
| 417 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…