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 (24 lines) | stat: -rw-r--r-- 863 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
includecommon("automate_stdio.lua")

mtn_setup()

-- check what happens if we give it no params (hint: it does not wait for stdin)
check(mtn("automate", "identify"), 1, false, false)

-- check if non-existing files are handled
check(mtn("automate", "identify", "non-existing-file"), 1, false, false)

-- check what happens if our filename is the stdin marker (hint: it should stop)
check(mtn("automate", "identify", "-"), 1, false, false)

-- finally check the actual functionality
writefile("testfile", "This is a testfile with test content.\n");
testfile_id = "4339e3c947e0d5abc83aef850db5ad6687559ae1"

check(mtn("automate", "identify", "testfile"), 0, true, false)
canonicalize("stdout")
check(samelines("stdout", { testfile_id }));

-- ensure that it also gets properly encoded via stdio
check(run_stdio("l8:identify8:testfilee", 0) == testfile_id .. "\n")