File: __driver__.lua

package info (click to toggle)
monotone 1.1-4
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 20,648 kB
  • sloc: cpp: 86,443; sh: 6,906; perl: 924; makefile: 838; python: 517; lisp: 379; sql: 118; exp: 91; ansic: 52
file content (35 lines) | stat: -rw-r--r-- 1,373 bytes parent folder | download | duplicates (5)
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

check(get("rcfile.lua"))

mtn_setup()

function mt(...)
    return nodb_mtn("--rcfile", "rcfile.lua", ...)
end

-- at first some fun with invalid database aliases
check(mt("ls", "branches", "-d", ":not-existing.mtn"), 1, false, true)
check(qgrep("managed_databases/not-existing.mtn.+does.+not.+exist", "stderr"))

check(mt("ls", "branches", "-d", ":"), 1, false, true)
check(qgrep("invalid database alias ':': must not be empty", "stderr"))

check(mt("ls", "branches", "-d", ":/foo.mtn"), 1, false, true)
check(qgrep("invalid database alias ':/foo.mtn': does contain invalid characters", "stderr"))

-- check that this invalidness is also checked for values from the hook
check(mt("setup", "-b", "foo", "foo"), 1, false, true)
check(qgrep("invalid database alias 'invalid': does not start with a colon", "stderr"))

-- now check if we get prompted to resolve a ambiguous alias
mkdir("managed_databases")
mkdir("other_managed_databases")

check(nodb_mtn("db", "init", "-d", "managed_databases/foo.mtn"), 0, false, false)
check(nodb_mtn("db", "init", "-d", "other_managed_databases/foo.mtn"), 0, false, false)

check(mt("ls", "branches", "-d", ":foo.mtn"), 1, false, true)
check(qgrep("the database alias ':foo.mtn' has multiple ambiguous expansions", "stderr"))
check(qgrep("managed_databases/foo.mtn", "stderr"))
check(qgrep("other_managed_databases/foo.mtn", "stderr"))