summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/experimental/filesystem/fs.op.funcs
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2016-10-16 00:29:22 +0000
committerEric Fiselier <eric@efcs.ca>2016-10-16 00:29:22 +0000
commitae4c3e16999b9f5ae1932df7df188cd8b1e970fb (patch)
treed6bb5eae22bb2963a6d4a213e52ac6279ad4fa66 /libcxx/test/std/experimental/filesystem/fs.op.funcs
parent736538b0fc719f0b2db249e4d007598e13b9dbcf (diff)
downloadbcm5719-llvm-ae4c3e16999b9f5ae1932df7df188cd8b1e970fb.tar.gz
bcm5719-llvm-ae4c3e16999b9f5ae1932df7df188cd8b1e970fb.zip
Implement LWG 2681 and 2682
llvm-svn: 284316
Diffstat (limited to 'libcxx/test/std/experimental/filesystem/fs.op.funcs')
-rw-r--r--libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy/copy.pass.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy/copy.pass.cpp b/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy/copy.pass.cpp
index 61d963a510d..6e10ce51ce3 100644
--- a/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy/copy.pass.cpp
+++ b/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy/copy.pass.cpp
@@ -257,6 +257,47 @@ TEST_CASE(from_is_directory)
}
}
+TEST_CASE(test_copy_symlinks_to_symlink_dir)
+{
+ scoped_test_env env;
+ const path file1 = env.create_file("file1", 42);
+ const path file2 = env.create_file("file2", 101);
+ const path file2_sym = env.create_symlink(file2, "file2_sym");
+ const path dir = env.create_dir("dir");
+ const path dir_sym = env.create_symlink(dir, "dir_sym");
+ {
+ std::error_code ec = GetTestEC();
+ fs::copy(file1, dir_sym, copy_options::copy_symlinks, ec);
+ TEST_CHECK(!ec);
+ const path dest = env.make_env_path("dir/file1");
+ TEST_CHECK(exists(dest));
+ TEST_CHECK(!is_symlink(dest));
+ TEST_CHECK(file_size(dest) == 42);
+ }
+}
+
+
+TEST_CASE(test_dir_create_symlink)
+{
+ scoped_test_env env;
+ const path dir = env.create_dir("dir1");
+ const path dest = env.make_env_path("dne");
+ {
+ std::error_code ec = GetTestEC();
+ fs::copy(dir, dest, copy_options::create_symlinks, ec);
+ TEST_CHECK(ec == std::make_error_code(std::errc::is_a_directory));
+ TEST_CHECK(!exists(dest));
+ TEST_CHECK(!is_symlink(dest));
+ }
+ {
+ std::error_code ec = GetTestEC();
+ fs::copy(dir, dest, copy_options::create_symlinks|copy_options::recursive, ec);
+ TEST_CHECK(ec == std::make_error_code(std::errc::is_a_directory));
+ TEST_CHECK(!exists(dest));
+ TEST_CHECK(!is_symlink(dest));
+ }
+}
+
TEST_CASE(test_otherwise_no_effects_clause)
{
scoped_test_env env;
OpenPOWER on IntegriCloud