| 192 | } |
| 193 | |
| 194 | bool 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; |
nothing calls this directly
no test coverage detected
searching dependent graphs…