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 (58 lines) | stat: -rw-r--r-- 1,541 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
function test_one(base)
   local src = base .. ".src"
   local dst = base .. ".dst"
   local ud  = base .. ".ud"
   local cd  = base .. ".cd"
   local udp = base .. ".udp"
   local cdp = base .. ".cdp"
   if not get(src) or not get(dst) 
      or not get(ud) or not get(cd) 
      or not get(udp) or not get(cdp)
   then
      error("case '" .. base .. "': missing file", 2)
      return
   end
   check(mtn("fload"), 0, nil, nil, {src})
   check(mtn("fload"), 0, nil, nil, {dst})
   src = sha1(src)
   dst = sha1(dst)

   check(mtn("fdiff", "--no-show-encloser", base, base, src, dst), 0, true, nil, nil)
   canonicalize("stdout")
   check(samefile("stdout", ud))
   check(mtn("fdiff", "--context", "--no-show-encloser", base, base, src, dst),
         0, true, nil, nil)
   canonicalize("stdout")
   check(samefile("stdout", cd))
   check(mtn("fdiff", base, base, src, dst), 
         0, true, nil, nil)
   canonicalize("stdout")
   check(samefile("stdout", udp))
   check(mtn("fdiff", "--context", base, base, src, dst),
         0, true, nil, nil)
   canonicalize("stdout")
   check(samefile("stdout", cdp))
end

append("test_hooks.lua",
       "function get_encloser_pattern(name)\n"..
       "  if name == \"hello\" then\n"..
       "    return \"^[[:alnum:]$_]\"\n"..
       "  else\n"..
       "    return \"-- initial\"\n"..
       "  end\n"..
       "end\n")

mtn_setup()

test_one("hello")
test_one("A")
test_one("B")
test_one("C")
test_one("D")
test_one("E")
test_one("F")
test_one("G")
test_one("H")
test_one("I")
test_one("J")