tests/test-audit-path.t
author Brodie Rao <brodie@bitheap.org>
Wed, 22 Sep 2010 16:06:00 -0500
changeset 12375 02990e22150b
parent 12372 5163e3c8aa52
child 12376 97ffc68f71d3
permissions -rw-r--r--
tests: require regexes in unified tests to be marked with " (re)" Consider this test: $ hg glog --template '{rev}:{node|short} "{desc}"\n' @ 2:20c4f79fd7ac "3" | | o 1:38f24201dcab "2" |/ o 0:2a18120dc1c9 "1" Because each line beginning with "|" can be compiled as a regular expression (equivalent to ".*|"), they will match any output. Similarly: $ echo foo The blank output line can be compiled as a regular expression and will also match any output. With this patch, none of the above output lines will be matched as regular expressions. A line must end in " (re)" in order to be matched as one. Lines are still matched literally first, so the following will pass: $ echo 'foo (re)' foo (re)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
     1
  $ hg init
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
     2
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
     3
should fail
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
     4
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
     5
  $ hg add .hg/00changelog.i
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
     6
  abort: path contains illegal component: .hg/00changelog.i
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 11855
diff changeset
     7
  [255]
5158
d316124ebbea Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
     8
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
     9
  $ mkdir a
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    10
  $ echo a > a/a
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    11
  $ hg ci -Ama
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    12
  adding a/a
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    13
  $ ln -s a b
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    14
  $ echo b > a/b
5158
d316124ebbea Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    15
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    16
should fail
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    17
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    18
  $ hg add b/b
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    19
  abort: path 'b/b' traverses symbolic link 'b'
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 11855
diff changeset
    20
  [255]
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    21
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    22
should succeed
5158
d316124ebbea Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    23
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    24
  $ hg add b
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    25
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    26
should still fail - maybe
5158
d316124ebbea Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    27
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    28
  $ hg add b/b
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    29
  abort: path 'b/b' traverses symbolic link 'b'
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 11855
diff changeset
    30
  [255]
5158
d316124ebbea Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    31
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    32
unbundle tampered bundle
5158
d316124ebbea Make audit_path more stringent.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    33
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    34
  $ hg init target
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    35
  $ cd target
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    36
  $ hg unbundle $TESTDIR/tampered.hg
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    37
  adding changesets
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    38
  adding manifests
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    39
  adding file changes
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    40
  added 5 changesets with 6 changes to 6 files (+4 heads)
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    41
  (run 'hg heads' to see heads, 'hg merge' to merge)
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    42
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    43
attack .hg/test
7554
11a4eb81fb4f test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5158
diff changeset
    44
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    45
  $ hg manifest -r0
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    46
  .hg/test
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    47
  $ hg update -Cr0
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    48
  abort: path contains illegal component: .hg/test
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 11855
diff changeset
    49
  [255]
7554
11a4eb81fb4f test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5158
diff changeset
    50
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    51
attack foo/.hg/test
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    52
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    53
  $ hg manifest -r1
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    54
  foo/.hg/test
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    55
  $ hg update -Cr1
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    56
  abort: path 'foo/.hg/test' is inside repo 'foo'
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 11855
diff changeset
    57
  [255]
7554
11a4eb81fb4f test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5158
diff changeset
    58
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    59
attack back/test where back symlinks to ..
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    60
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    61
  $ hg manifest -r2
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    62
  back
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    63
  back/test
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    64
  $ hg update -Cr2
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    65
  abort: path 'back/test' traverses symbolic link 'back'
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 11855
diff changeset
    66
  [255]
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    67
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    68
attack ../test
7554
11a4eb81fb4f test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5158
diff changeset
    69
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    70
  $ hg manifest -r3
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    71
  ../test
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    72
  $ hg update -Cr3
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    73
  abort: path contains illegal component: ../test
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 11855
diff changeset
    74
  [255]
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    75
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    76
attack /tmp/test
7554
11a4eb81fb4f test-audit-path: add more tests (issue 1450)
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 5158
diff changeset
    77
11855
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    78
  $ hg manifest -r4
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    79
  /tmp/test
054b0d9c3f0c tests: unify test-audit-path
Martin Geisler <mg@lazybytes.net>
parents: 7681
diff changeset
    80
  $ hg update -Cr4
12375
02990e22150b tests: require regexes in unified tests to be marked with " (re)"
Brodie Rao <brodie@bitheap.org>
parents: 12372
diff changeset
    81
  abort: No such file or directory: .*/test-audit-path\.t/target//tmp/test (re)
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 11855
diff changeset
    82
  [255]