monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-devel] [PATCH] fix test "syntax_errors_in_.mtn-ignore"


From: Ralf S. Engelschall
Subject: [Monotone-devel] [PATCH] fix test "syntax_errors_in_.mtn-ignore"
Date: Wed, 10 Oct 2007 16:56:57 +0200
User-agent: Mutt/1.5.16 OpenPKG/CURRENT (2007-06-09)

A "make check" on h:n.v.m currently results in one failed test:
"syntax_errors_in_.mtn-ignore". The reasons is because the test performs
a "mtn ls unknown" command and checks the stderr output. Unfortunately,
it doesn't seem to be deterministic in what order the files are checked
against the Lua function ignore_file() and hence the first line ("mtn:
warning: while matching file 'XXXX':") of the stderr output of "mtn ls
unknown" contains an abitrary filename "XXXX" and hence lets the test
fail. There are multiple possibilities to fix this. I propose to simply
skip the first line of stderr during output comparisons:

Index: tests/syntax_errors_in_.mtn-ignore/__driver__.lua
--- tests/syntax_errors_in_.mtn-ignore/__driver__.lua   
40ae692978a4b62a47ad35468cc2e52656a68643
+++ tests/syntax_errors_in_.mtn-ignore/__driver__.lua   
b055aa0291460500b8f1520f3b18ef7a3c6445c3
@@ -13,4 +13,5 @@ check(samefile("stdout", "stdout-ref"))
 check(get("stderr-ref"))

 check(samefile("stdout", "stdout-ref"))
+check(string.gsub(readfile("stderr"),     "[^\r\n]*\r?\n", 1) ==
+      string.gsub(readfile("stderr-ref"), "[^\r\n]*\r?\n", 1))
-check(samefile("stderr", "stderr-ref"))

Any objections?
                                       Ralf S. Engelschall
                                       address@hidden
                                       www.engelschall.com





reply via email to

[Prev in Thread] Current Thread [Next in Thread]