[libcxx-commits] [PATCH] D89532: [libcxx] [test] Fix path.modifiers/make_preferred for windows

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Oct 16 05:48:55 PDT 2020


ldionne requested changes to this revision.
ldionne added inline comments.
This revision now requires changes to proceed.
Herald added a subscriber: dexonsmith.


================
Comment at: libcxx/test/std/input.output/filesystems/class.path/path.member/path.modifiers/make_preferred.pass.cpp:34
   {
-      {""}
-    , {"hello_world"}
-    , {"/"}
-    , {"/foo/bar/baz/"}
-    , {"\\"}
-    , {"\\foo\\bar\\baz\\"}
-    , {"\\foo\\/bar\\/baz\\"}
+      {"", nullptr}
+    , {"hello_world", nullptr}
----------------
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.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89532/new/

https://reviews.llvm.org/D89532



More information about the libcxx-commits mailing list