aboutsummaryrefslogtreecommitdiff
path: root/tests/test/script/builtin/touch.testscript
blob: 66691f7ab0b3eaf1356d0186d893f5994095d120 (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
# file      : tests/test/script/builtin/touch.testscript
# license   : MIT; see accompanying LICENSE file

.include ../common.testscript

: cleanup
:
{
  : enabled
  :
  $c <'touch a' && $b

  : disabled
  :
  $c <<EOI && $b
    touch --no-cleanup a;
    rm a
    EOI

  : existing
  :
  : Test that touching 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 first touch would fail.
  :
  $c <<EOI && $b
    {
      +touch a
      {
        touch ../a
      }
    }
    EOI
}