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"))
|