libstdc++: Improve testing for path::operator+=(const string&)
authorJonathan Wakely <jwakely@redhat.com>
Mon, 9 Dec 2019 09:59:00 +0000 (09:59 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Mon, 9 Dec 2019 09:59:00 +0000 (09:59 +0000)
* testsuite/27_io/filesystem/path/concat/strings.cc: Test more cases.

From-SVN: r279111

libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/27_io/filesystem/path/concat/strings.cc

index 32d539806ad67ed0c10a15a6b13c2d43ba2a583d..b9a58dd99b7bfe20c2906d3aea6a10a360ec567f 100644 (file)
@@ -1,5 +1,7 @@
 2019-12-09  Jonathan Wakely  <jwakely@redhat.com>
 
+       * testsuite/27_io/filesystem/path/concat/strings.cc: Test more cases.
+
        PR libstdc++/92853
        * src/c++17/fs_path.cc (filesystem::path::operator+=(const path&)):
        Do not process a trailing directory separator twice.
index 80ce25ef119a26cf03530b0bee438d83d556803d..f51707b171cb938ae48166bc9f99d3bffb55216b 100644 (file)
@@ -113,10 +113,29 @@ test03()
   p4 += s;
   compare_paths(p4, path(s0+'/'+s));
 }
+
+void
+test04()
+{
+  // Concat every test path onto every test path.
+  for (path p : __gnu_test::test_paths)
+  {
+    for (path x : __gnu_test::test_paths)
+    {
+      auto prior_native = p.native();
+      p += x.native();
+      VERIFY( p.native() == prior_native + x.native() );
+      path copy(p);
+      compare_paths( copy, p );
+    }
+  }
+}
+
 int
 main()
 {
   test01();
   test02();
   test03();
+  test04();
 }