Page MenuHomePhabricator

D11175.id.diff
No OneTemporary

D11175.id.diff

diff --git a/src/lint/linter/__tests__/ArcanistLinterTestCase.php b/src/lint/linter/__tests__/ArcanistLinterTestCase.php
--- a/src/lint/linter/__tests__/ArcanistLinterTestCase.php
+++ b/src/lint/linter/__tests__/ArcanistLinterTestCase.php
@@ -29,7 +29,9 @@
$contents = preg_split('/^~{4,}\n/m', $contents);
if (count($contents) < 2) {
throw new Exception(
- "Expected '~~~~~~~~~~' separating test case and results.");
+ pht(
+ "Expected '%s' separating test case and results.",
+ '~~~~~~~~~~'));
}
list ($data, $expect, $xform, $config) = array_merge(
@@ -96,7 +98,7 @@
$this->assertEqual(
1,
count($results),
- 'Expect one result returned by linter.');
+ pht('Expect one result returned by linter.'));
$result = reset($results);
$patcher = ArcanistLintPatcher::newFromArcanistLintResult($result);
@@ -140,7 +142,11 @@
$message_key = $sev.':'.$line.':'.$char;
$message_map[$message_key] = $message;
$seen[] = $message_key;
- $raised[] = " {$sev} at line {$line}, char {$char}: {$code} {$name}";
+ $raised[] = sprintf(
+ ' %s: %s %s',
+ pht('%s at line %d, char %d', $sev, $line, $char),
+ $code,
+ $name);
}
$expect = trim($expect);
if ($expect) {
@@ -156,16 +162,25 @@
$seen = array_fill_keys($seen, true);
if (!$raised) {
- $raised = array('No messages.');
+ $raised = array(pht('No messages.'));
}
- $raised = "Actually raised:\n".implode("\n", $raised);
+ $raised = sprintf(
+ "%s:\n%s",
+ pht('Actually raised'),
+ implode("\n", $raised));
foreach (array_diff_key($expect, $seen) as $missing => $ignored) {
list($sev, $line, $char) = explode(':', $missing);
$this->assertFailure(
- "In '{$file}', ".
- "expected lint to raise {$sev} on line {$line} at char {$char}, ".
- "but no {$sev} was raised. {$raised}");
+ pht(
+ "In '%s', expected lint to raise %s on line %d at char %d, ".
+ "but no %s was raised. %s",
+ $file,
+ $sev,
+ $line,
+ $char,
+ $sev,
+ $raised));
}
foreach (array_diff_key($seen, $expect) as $surprising => $ignored) {
@@ -174,9 +189,17 @@
list($sev, $line, $char) = explode(':', $surprising);
$this->assertFailure(
- "In '{$file}', ".
- "lint raised {$sev} on line {$line} at char {$char}, ".
- "but nothing was expected:\n\n{$message_info}\n\n{$raised}");
+ sprintf(
+ "%s:\n\n%s\n\n%s",
+ pht(
+ "In '%s', lint raised %s on line %d at char %d, ".
+ "but nothing was expected",
+ $file,
+ $sev,
+ $line,
+ $char),
+ $message_info,
+ $raised));
}
}
@@ -187,7 +210,7 @@
$this->assertEqual(
$expected,
$actual,
- 'File as patched by lint did not match the expected patched file.');
+ pht('File as patched by lint did not match the expected patched file.'));
}
}

File Metadata

Mime Type
text/plain
Expires
Fri, Mar 28, 9:45 AM (1 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7724491
Default Alt Text
D11175.id.diff (3 KB)

Event Timeline