File: __driver__.lua

package info (click to toggle)
monotone 0.31-6
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 20,680 kB
  • ctags: 14,801
  • sloc: cpp: 87,711; ansic: 64,862; sh: 5,691; lisp: 954; perl: 783; makefile: 509; python: 265; sql: 98; sed: 16
file content (45 lines) | stat: -rw-r--r-- 1,455 bytes parent folder | download
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

mtn_setup()
revs = {}

addfile("testfile", "this is just a file")
copy("testfile", "testfile1")
commit()
revs.first = base_revision()

writefile("testfile", "Now, this is a different file")
copy("testfile", "testfile2")
commit()
revs.second = base_revision()

writefile("testfile", "And we change it a third time")
copy("testfile", "testfile3")
commit()

check(mtn("cert", revs.first, "testcert", 'value=with=equal=signs'))
check(mtn("cert", revs.second, "testcert", 'value'))

-- Check that inexact values fail...
check(mtn("list", "certs", "'c:testcert=value='"), 1, false, true)
check(grep('no match for selection', "stderr"), 0, false)

-- Check that wild cards succeed...
check(mtn("list", "certs", "c:testcert=value=*"), 0, false, false)

-- Check that wild cards succeed (this one becomes a misuse, because it will
-- match two revisions)...
check(mtn("list", "certs", "c:testcert=value*"), 1, false, true)
check(grep('has multiple ambiguous expansions', "stderr"), 0, false)

-- Check that no value succeeds...
check(mtn("list", "certs", "c:testcert"), 1, false, true)
check(grep('has multiple ambiguous expansions', "stderr"), 0, false)

-- Check that exact value succeed...
remove("_MTN")
check(mtn("co", "--revision=c:testcert=value", "."), 0, false, false)
check(samefile("testfile", "testfile2"))

remove("_MTN")
check(mtn("co", "--revision=c:testcert=value=with=equal=signs", "."), 0, false, false)
check(samefile("testfile", "testfile1"))