3 final class DiffusionMercurialCommandEngineTests
extends PhabricatorTestCase
{
5 public function testFilteringDebugOutput() {
9 "quack\n" => "quack\n",
11 "ignoring untrusted configuration option x.y = z\nquack\n" =>
14 "ignoring untrusted configuration option x.y = z\n".
15 "ignoring untrusted configuration option x.y = z\n".
19 "ignoring untrusted configuration option x.y = z\n".
20 "ignoring untrusted configuration option x.y = z\n".
21 "ignoring untrusted configuration option x.y = z\n".
26 "ignoring untrusted configuration option x.y = z\n".
27 "ignoring untrusted configuration option x.y = z\n".
28 "ignoring untrusted configuration option x.y = z\n" =>
31 "ignoring untrusted configuration option x.y = z\n".
32 "ignoring untrusted configuration option x.y = z\n".
34 "ignoring untrusted configuration option x.y = z\n".
35 "ignoring untrusted configuration option x.y = z\n".
37 "ignoring untrusted configuration option x.y = z\n".
39 "duck\nbread\nquack\n",
41 "ignoring untrusted configuration option x.y = z\n".
42 "duckignoring untrusted configuration option x.y = z\n".
47 foreach ($map as $input => $expect) {
48 $actual = DiffusionMercurialCommandEngine
::filterMercurialDebugOutput(
50 $this->assertEqual($expect, $actual, $input);
53 // Output that should be filtered out from the results
55 "ignoring untrusted configuration option\n".
56 "couldn't write revision branch cache:\n".
57 "couldn't write branch cache: blah blah blah\n".
58 "invalid branchheads cache\n".
59 "invalid branch cache (served): tip differs\n".
60 "starting pager for command 'log'\n".
62 ".hglf/project/src/a/b/c/SomeClass.java, ".
63 "project/src/a/b/c/SomeClass.java\n".
64 "no terminfo entry for sitm\n";
67 DiffusionMercurialCommandEngine
::filterMercurialDebugOutput($output);
69 $this->assertEqual('', $filtered_output);
71 // The output that should make it through the filtering
73 "0b33a9e5ceedba14b03214f743957357d7bb46a9;694".
74 ":8b39f63eb209dd2bdfd4bd3d0721a9e38d75a6d3".
75 "-1:0000000000000000000000000000000000000000\n".
76 "8b39f63eb209dd2bdfd4bd3d0721a9e38d75a6d3;693".
77 ":165bce9ce4ccc97024ba19ed5a22f6a066fa6844".
78 "-1:0000000000000000000000000000000000000000\n".
79 "165bce9ce4ccc97024ba19ed5a22f6a066fa6844;692:".
80 "2337bc9e3cf212b3b386b5197801b1c81db64920".
81 "-1:0000000000000000000000000000000000000000\n";
84 DiffusionMercurialCommandEngine
::filterMercurialDebugOutput($output);
86 $this->assertEqual($output, $filtered_output);