# file : tests/test/script/builtin/cp.testscript # license : MIT; see accompanying LICENSE file .include ../common.testscript : file : : Test synopsis 1: make a file copy at the specified path. : { : cleanup : { : enabled : $c <<EOI && $b touch a; cp a b EOI : disabled : $c <<EOI && $b touch a; cp --no-cleanup a b; rm b EOI : existing : : Test that copy over an existing file does not register cleanup. If it : does then the file would be removed while leaving the embedded scope, : and so the cleanup registered by the outer touch would fail. : $c <<EOI && $b +touch b { touch a; cp a ../b } EOI } } : dir : : Test synopsis 2: make a directory copy at the specified path. : { : cleanup : $c <<EOI && $b mkdir a; touch a/b; cp -r a b EOI : no-cleanup : $c <<EOI && $b mkdir a; touch a/b; cp --no-cleanup -r a b; rm -r b EOI } : files : : Test synopsis 3: copy files into the specified directory. : { : cleanup : $c <<EOI && $b touch a b; mkdir c; cp a b c/ EOI : no-cleanup : $c <<EOI && $b touch a b; mkdir c; cp --no-cleanup a b c/; rm c/a c/b EOI } : filesystem-entries : : Test synopsis 4: copy filesystem entries into the specified directory. : { : cleanup : $c <<EOI && $b mkdir a b; touch c a/c; cp -R a c b/ EOI : no-cleanup : $c <<EOI && $b mkdir a b; touch c a/c; cp --no-cleanup -R a c b/; rm -r b/a/ b/c EOI }