[libcxx-commits] [PATCH] D98127: [libcxx] [test] Clarify and improve consistency in lexically_relative_and_proximate.pass.cpp. NFC.

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Mar 7 01:51:02 PST 2021

mstorsjo added inline comments.

Comment at: libcxx/test/std/input.output/filesystems/class.path/path.member/path.gen/lexically_relative_and_proximate.pass.cpp:90
+    if (!PathEq(proximate_output, proximate_expected))
       ReportErr("path::lexically_proximate", proximate_output, proximate_expected);
Quuxplusone wrote:
> Please name the variable `proximate_expect` instead of `proximate_expected`; or else name the variable and field above `expected` instead of `expect`. But they should be consistent with each other, one way or another.
> I had suggested using `expect.empty()` instead of `expect.native().empty()`, on the assumption that they do the same thing. I just checked the code in `<filesystem>` to be sure, and yeah, it sure //looks// like they do the same thing. Can //you// think of any reason the original programmer might have used `expect.native().empty()` here instead of the more natural `expect.empty()`?
I can't see a good reason not to just use path::empty(), changing to use that. And renaming the variable.

  rG LLVM Github Monorepo



More information about the libcxx-commits mailing list