diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2025-01-30 17:02:47 +0000 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2025-03-25 12:33:38 +0000 |
commit | 466da4baba46608882d16d121fa46d33f841bc7b (patch) | |
tree | 38d569ec52611e3cce90020fe1c5e0c1da5e5af7 /libstdc++-v3/testsuite | |
parent | a86891525d200c1ae81d9f5f441a5b8e24b647ca (diff) | |
download | gcc-466da4baba46608882d16d121fa46d33f841bc7b.zip gcc-466da4baba46608882d16d121fa46d33f841bc7b.tar.gz gcc-466da4baba46608882d16d121fa46d33f841bc7b.tar.bz2 |
libstdc++: Add testcase for std::filesystem::copy [PR118699]
This was fixed last year by r15-2409-g017e3f89b081e4 (and backports), so
just add the testcase.
libstdc++-v3/ChangeLog:
PR libstdc++/118699
* testsuite/27_io/filesystem/operations/copy.cc: Check copying a
file to a directory.
Diffstat (limited to 'libstdc++-v3/testsuite')
-rw-r--r-- | libstdc++-v3/testsuite/27_io/filesystem/operations/copy.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/27_io/filesystem/operations/copy.cc b/libstdc++-v3/testsuite/27_io/filesystem/operations/copy.cc index c302d9a..289bef6 100644 --- a/libstdc++-v3/testsuite/27_io/filesystem/operations/copy.cc +++ b/libstdc++-v3/testsuite/27_io/filesystem/operations/copy.cc @@ -228,6 +228,23 @@ test_pr99290() remove_all(dir); } +void +test_pr118699() +{ + auto dir = __gnu_test::nonexistent_path(); + fs::create_directories(dir/"a"); + fs::create_directories(dir/"c"); + std::ofstream{dir/"a/b.txt"} << "b"; + std::ofstream{dir/"a/bb.txt"} << "bb"; + + fs::copy(dir/"a/b.txt", dir/"c"); + auto ec = make_error_code(std::errc::invalid_argument); + fs::copy(dir/"a/bb.txt", dir/"c", ec); + VERIFY( !ec ); + + remove_all(dir); +} + int main() { @@ -237,4 +254,5 @@ main() test04(); test05(); test_pr99290(); + test_pr118699(); } |