Roxen.git / server / etc / test / tests / pike_test_common.pike

version» Context lines:

Roxen.git/server/etc/test/tests/pike_test_common.pike:47:    66, sprintf (" %c ", checkid)));    else    report_error("%3d%c %s ", current_test, checkid,    pad_to_column (describe_test (cb, args),    66, sprintf (" %c ", checkid)));   }      string indent( int l, string what )   {    array q = what/"\n"; - // if( q[-1] == "" ) q = q[..sizeof(q)-2]; +  int trailing_nl = q[-1] == ""; +  if (trailing_nl) q = q[..<1];    string i = (" "*l+"| "); -  return i+q*("\n"+i); +  return i+q*("\n"+i) + (trailing_nl ? "\n" : "");   }    -  + void log (string msg, mixed... args) + { +  if (sizeof (args)) msg = sprintf (msg, @args); +  report_debug (indent (2, msg)); + } +  + void log_verbose (string msg, mixed... args) + { +  if (!verbose) return; +  if (sizeof (args)) msg = sprintf (msg, @args); +  report_debug (indent (2, msg)); + } +    string do_describe_error( mixed err )   {    if (!stringp (err)) err = describe_backtrace (err);    if (has_suffix (err, "\n")) err = err[..<1];    return indent(2, err) + "\n";   }      void report_test_failure( mixed err,    function|string|array cb, array args, int st )   {