aboutsummaryrefslogtreecommitdiff
path: root/tests/test/script/builtin/ln.testscript
blob: 542b0c7aa90c718432d9d1ba57b4c7db8124f93d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# file      : tests/test/script/builtin/ln.testscript
# license   : MIT; see accompanying LICENSE file

.include ../common.testscript

: file
:
: Test creating a file symlink.
:
{
  : cleanup
  :
  $c <<EOI && $b
    touch a;
    ln -s a b
    EOI

  : no-cleanup
  :
  $c <<EOI && $b
    touch a;
    ln -s --no-cleanup a b;
    rm b
    EOI
}

: dir
:
: Test creating a directory symlink.
:
{
  : cleanup
  :
  $c <<EOI && $b
    mkdir a;
    touch a/b;
    ln -s a c
    EOI

  : no-cleanup
  :
  $c <<EOI && $b
    mkdir a;
    touch a/b;
    ln -s --no-cleanup a c;
    rm -r c
    EOI
}

: multiple-targets
:
: Test creating links for multiple targets in the specified directory.
:
{
  : cleanup
  :
  $c <<EOI && $b
    mkdir b c;
    touch a b/c;
    ln -s ../a ../b c/
    EOI

  : no-cleanup
  :
  $c <<EOI && $b
    mkdir b c;
    touch a b/c;
    ln -s --no-cleanup ../a ../b c/;
    rm -r c/a c/b
    EOI
}