This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] [test] Clarify and improve consistency in lexically_relative_and_proximate.pass.cpp. NFC.
ClosedPublic

Authored by mstorsjo on Mar 6 2021, 12:57 PM.

Details

Summary

Use "expect" instead of "output" for generating "proximate_expected".
pass the arguments to PathEq in the same order as above.

Diff Detail

Event Timeline

mstorsjo requested review of this revision.Mar 6 2021, 12:57 PM
mstorsjo created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptMar 6 2021, 12:57 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
curdeius accepted this revision as: curdeius.Mar 6 2021, 1:57 PM
curdeius added a subscriber: curdeius.

LGTM.

Quuxplusone added inline comments.
libcxx/test/std/input.output/filesystems/class.path/path.member/path.gen/lexically_relative_and_proximate.pass.cpp
87–89

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()?

mstorsjo added inline comments.Mar 7 2021, 1:51 AM
libcxx/test/std/input.output/filesystems/class.path/path.member/path.gen/lexically_relative_and_proximate.pass.cpp
87–89

I can't see a good reason not to just use path::empty(), changing to use that. And renaming the variable.

mstorsjo updated this revision to Diff 328851.Mar 7 2021, 1:52 AM

Renamed the variable, using .empty() instead of .native().empty()

Quuxplusone accepted this revision.Mar 7 2021, 9:09 AM
This revision is now accepted and ready to land.Mar 7 2021, 9:09 AM
This revision was automatically updated to reflect the committed changes.