Commit 1d214c3f by Jonathan Wakely Committed by Jonathan Wakely

libstdc++: Improve testing for path::operator+=(const string&)

	* testsuite/27_io/filesystem/path/concat/strings.cc: Test more cases.

From-SVN: r279111
parent 023a3fb4
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.
......
......@@ -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();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment