aboutsummaryrefslogtreecommitdiff
path: root/tests/dir-iterator/testscript
blob: 370fd2f69fb389a6a4e84caa94e714fc914680b4 (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
# file      : tests/dir-iterator/testscript
# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd
# license   : MIT; see accompanying LICENSE file

test.options = -v

: file
:
mkdir a;
touch a/b;
$* a >"reg     b"

: dir
:
mkdir -p a/b;
$* a >"dir     b"

# Note that on Windows only directory symlinks are currently supported (see
# mksymlink() for details).
#
: dangling-link
:
if ($cxx.target.class != 'windows')
{
  +mkdir a
  +touch --no-cleanup a/b
  +ln -s a/b a/l
  +rm a/b

  +touch a/c

  $* ../a     >! 2>!       != 0 : keep
  $* -i ../a  >'reg     c'      : skip
}
else
{
  +mkdir a
  +mkdir --no-cleanup a/b
  +ln -s a/b a/bl
  +rmdir a/b

  +touch a/c

  +mkdir a/d
  +ln -s a/d a/dl

  # On Wine dangling symlinks are not visible (see mksymlink() for details).
  #
  #$* ../a >! 2>! != 0 : keep

  : skip
  :
  $* -i ../a >>~%EOO%
    %(reg     c|dir     d|sym dir dl)%{3}
    EOO
}