aboutsummaryrefslogtreecommitdiff
path: root/tests/test/script/builtin/ln.test
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-09-03 16:37:32 +0200
committerKaren Arutyunov <karen@codesynthesis.com>2018-09-04 16:29:59 +0300
commit5007870b52aa549971824959a55ad3bb886f09e0 (patch)
treeb0ef7f24c0b9ece2ed23f3c1792f16da324e4171 /tests/test/script/builtin/ln.test
parent09d60452a80d14d9b8bf3a9395860b50683fa1e8 (diff)
Rename .test/test{} to .testscript/testscript{}
Diffstat (limited to 'tests/test/script/builtin/ln.test')
-rw-r--r--tests/test/script/builtin/ln.test184
1 files changed, 0 insertions, 184 deletions
diff --git a/tests/test/script/builtin/ln.test b/tests/test/script/builtin/ln.test
deleted file mode 100644
index 8b4c30e..0000000
--- a/tests/test/script/builtin/ln.test
+++ /dev/null
@@ -1,184 +0,0 @@
-# file : tests/test/script/builtin/ln.test
-# copyright : Copyright (c) 2014-2018 Code Synthesis Ltd
-# license : MIT; see accompanying LICENSE file
-
-.include ../common.test
-
-: args
-:
-{
- : -s-option
- :
- $c <'ln 2>"ln: missing -s option" == 1' && $b
-
- : none
- :
- $c <'ln -s 2>"ln: missing arguments" == 1' && $b
-
- : no-target
- :
- $c <'ln -s a 2>"ln: missing target path" == 1' && $b
-
- : no-trailing-sep
- :
- $c <<EOI && $b
- ln -s a b c 2>"ln: multiple target paths with non-directory link path" == 1
- EOI
-
- : empty
- :
- {
- : link
- :
- $c <<EOI && $b
- ln -s '' 2>"ln: invalid path ''" == 1
- EOI
-
- : target1
- :
- $c <<EOI && $b
- ln -s '' a 2>"ln: invalid path ''" == 1
- EOI
-
- : target2
- :
- $c <<EOI && $b
- ln -s '' a b/ 2>"ln: invalid path ''" == 1
- EOI
- }
-}
-
-: file
-:
-: Test creating a file symlink.
-:
-{
- : non-existing-link-path
- :
- $c <<EOI && $b
- touch a;
- ln -s a b && test -f b
- EOI
-
- : existing-link
- :
- {
- : file
- :
- $c <<EOI && $b
- touch a b;
- ln -s a b 2>>/~%EOE% != 0
- %(
- %ln: unable to create .+link '.+/b' to '.+/a': .+%|
- %ln: unable to copy file '.+/a' to '.+/b': .+%
- %)
- EOE
- EOI
-
- : dir
- :
- $c <<EOI && $b
- touch a;
- mkdir b;
- ln -s a b 2>>/~%EOE% != 0
- %(
- %ln: unable to create .+link '.+/b' to '.+/a': .+%|
- %ln: unable to copy file '.+/a' to '.+/b': .+%
- %)
- EOE
- EOI
- }
-
- : non-existing
- {
- : target
- :
- $c <<EOI && $b
- ln -s a b 2>>/~%EOE% != 0
- %ln: unable to create symlink to '.+/a': no such file or directory%
- EOE
- EOI
-
- : link-dir
- :
- $c <<EOI && $b
- touch a;
- ln -s a b/c 2>>/~%EOE% != 0
- %(
- %ln: unable to create .+link '.+/b/c' to '.+/a': .+%|
- %ln: unable to copy file '.+/a' to '.+/b/c': .+%
- %)
- EOE
- EOI
- }
-}
-
-: dir
-:
-: Test creating a directory symlink.
-:
-{
- : non-existing-link-path
- :
- $c <<EOI && $b
- mkdir a;
- touch a/b;
- ln -s a c && test -f c/b
- EOI
-
- : existing-link
- :
- {
- : dir
- :
- $c <<EOI && $b
- mkdir a b;
- ln -s a b 2>>/~%EOE% != 0
- %(
- %ln: unable to create .+link '.+/b' to '.+/a': .+%|
- %ln: unable to copy directory '.+/a' to '.+/b': .+%
- %)
- EOE
- EOI
-
- : file
- :
- $c <<EOI && $b
- mkdir a;
- touch b;
- ln -s a b 2>>/~%EOE% != 0
- %(
- %ln: unable to create .+link '.+/b' to '.+/a': .+%|
- %ln: unable to copy directory '.+/a' to '.+/b': .+%
- %)
- EOE
- EOI
- }
-
- : non-existing
- {
- : link-dir
- :
- $c <<EOI && $b
- mkdir a;
- ln -s a b/c 2>>/~%EOE% != 0
- %(
- %ln: unable to create .+link '.+/b/c' to '.+/a': .+%|
- %ln: unable to copy directory '.+/a' to '.+/b/c': .+%
- %)
- EOE
- EOI
- }
-}
-
-: multiple-targets
-:
-: Test creating links for multiple targets in the specified directory.
-:
-{
- $c <<EOI && $b
- touch a;
- mkdir b c;
- ln -s a b c/ && test -f c/a && test -d c/b
- EOI
-}