Use p.string() instead of p.native() for comparing with the expected value.
Explicitly list the expected values for both posix and windos, even if the operation is an identity operation on posix.
Differential D89532
[libcxx] [test] Fix path.modifiers/make_preferred for windows Authored by mstorsjo on Oct 16 2020, 3:33 AM.
Details
Use p.string() instead of p.native() for comparing with the expected value. Explicitly list the expected values for both posix and windos, even if the operation is an identity operation on posix.
Diff Detail
Event Timeline
| ||||||||||
I would rather this be changed to:
struct MakePreferredTestcase { const char* value; const char* expected_posix; const char* expected_windows; };and then
const MakePreferredTestcase TestCases[] = { {"", "", ""} , {"hello_world", "", ""} , {"/", "/", "\\"} , {"/foo/bar/baz/", "/foo/bar/baz/", "\\foo\\bar\\baz\\"} , {"\\", "\\", "\\"} , ... };I find it easier to follow.