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 (33 lines) | stat: -rw-r--r-- 733 bytes parent folder | download | duplicates (4)
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
-- Test that --confdir gets passed properly on file: sync

skip_if(ostype == "Windows") -- file: not supported on native Win32

mtn_setup()

copy("test.db", "test2.db")

addfile("testfile", "foo")
commit()

rcfile = io.open('test_hooks.lua', 'a')
if rcfile ~= nil then
   rcfile:write('\n')
   rcfile:write('x = io.open("checkfile", "a")\n')
   rcfile:write('x:write(get_confdir() .. "\\n")')
   rcfile:write('x:close()\n')
   rcfile:close()
end

test_uri="file://" .. url_encode_path(test.root .. "/test2.db") .. "?testbranch"
check(mtn("sync", test_uri), 0, true, false)

n = 0


testroot_unix = string.gsub(test.root, '\\', '/')

for line in io.lines("checkfile") do
   check(line == testroot_unix)
   n = n + 1
end
check(n == 2)