[libcxx-commits] [PATCH] D89945: [libcxx] [test] Use separate referenes for windows in the path.append test

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Mar 4 13:18:49 PST 2021


mstorsjo added inline comments.


================
Comment at: libcxx/test/std/input.output/filesystems/class.path/path.member/path.append.pass.cpp:46
 #ifdef _WIN32
-      , {S("foo"),     S("C:/bar"),   S("C:/bar")}
-      , {S("foo"),     S("C:"),       S("C:")}
-
-      , {S("C:"),      S(""),         S("C:")}
-      , {S("C:foo"),   S("/bar"),     S("C:/bar")}
-      , {S("C:foo"),   S("bar"),      S("C:foo/bar")}
-      , {S("C:/foo"),  S("bar"),      S("C:/foo/bar")}
-      , {S("C:/foo"),  S("/bar"),     S("C:/bar")}
-
-      , {S("C:foo"),   S("C:/bar"),   S("C:/bar")}
-      , {S("C:foo"),   S("C:bar"),    S("C:foo/bar")}
-      , {S("C:/foo"),  S("C:/bar"),   S("C:/bar")}
-      , {S("C:/foo"),  S("C:bar"),    S("C:/foo/bar")}
-
-      , {S("C:foo"),   S("c:/bar"),   S("c:/bar")}
-      , {S("C:foo"),   S("c:bar"),    S("c:bar")}
-      , {S("C:/foo"),  S("c:/bar"),   S("c:/bar")}
-      , {S("C:/foo"),  S("c:bar"),    S("c:bar")}
-
-      , {S("C:/foo"),  S("D:bar"),    S("D:bar")}
+#define expect expect_windows
 #else
----------------
ldionne wrote:
> Let's use a function for this:
> 
> ```
> MultiStringType const& expected_result(AppendOperatorTestcase const& tc) {
> #if defined(_WIN32)
>   return tc. expect_windows;
> #else
>   return tc.expect_posix;
> #endif
> };
> ```
> 
> Then, use `expected_result(TC)` below instead of `TC.expect`. WDYT? Feel free to make it a member function if you prefer.
That sounds good, thanks, will do. I'll go with a member function in this case, not that it really matters.


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

https://reviews.llvm.org/D89945



More information about the libcxx-commits mailing list