[libcxx] [test] Clarify and improve consistency in lexically_relative_and_proximate...
authorMartin Storsjö <martin@martin.st>
Sat, 6 Mar 2021 17:40:51 +0000 (19:40 +0200)
committerMartin Storsjö <martin@martin.st>
Sun, 7 Mar 2021 21:15:05 +0000 (23:15 +0200)
Use "expect" instead of "output" for generating "proximate_expected",
pass the arguments to PathEq in the same order as above, rename the
"proximate_expected" variable to be consistent with the naming of the
earlier "expect", use .empty() instead of .native().empty().

Differential Revision: https://reviews.llvm.org/D98127

libcxx/test/std/input.output/filesystems/class.path/path.member/path.gen/lexically_relative_and_proximate.pass.cpp

index 5760557..127cc7f 100644 (file)
@@ -84,10 +84,9 @@ int main(int, char**) {
     // [path.gen] lexically_proximate
     // Returns: If the value of lexically_relative(base) is not an empty path,
     // return it. Otherwise return *this.
-    const fs::path proximate_expected = output.native().empty() ? p
-        : output;
-    if (!PathEq(proximate_expected, proximate_output))
-      ReportErr("path::lexically_proximate", proximate_output, proximate_expected);
+    const fs::path proximate_expect = expect.empty() ? p : expect;
+    if (!PathEq(proximate_output, proximate_expect))
+      ReportErr("path::lexically_proximate", proximate_output, proximate_expect);
   }
   return Failed;
 }