File: __driver__.lua

package info (click to toggle)
monotone 1.1-9
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 20,984 kB
  • ctags: 8,622
  • sloc: cpp: 86,450; sh: 6,906; perl: 924; makefile: 813; python: 517; lisp: 379; sql: 118; exp: 91; ansic: 52
file content (37 lines) | stat: -rw-r--r-- 1,091 bytes parent folder | download | duplicates (7)
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

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("automate", "select", "c:testcert=value="), 0, true, false)
check(numlines("stdout") == 0)

-- Check that wild cards succeed (this one becomes a misuse, because it will
-- match two revisions)...
check(mtn("automate", "select", "c:testcert=value*"), 0, true, false)
check(numlines("stdout") == 2)

-- Check that no value succeeds...
check(mtn("automate", "select", "c:testcert"), 0, true, false)
check(numlines("stdout") == 2)

-- Check that exact value succeed...
check(mtn("automate", "select", "c:testcert=value"), 0, true, false)
check(numlines("stdout") == 1)