Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14016791
D20532.id48962.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D20532.id48962.diff
View Options
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
@@ -186,27 +186,37 @@
$message = new ArcanistLintMessage();
- $severity = idx($parts, 0);
- $line = idx($parts, 1);
- $char = idx($parts, 2);
- $code = idx($parts, 3);
+ $severity = idx($parts, 0);
+ $line = idx($parts, 1);
+ $char = idx($parts, 2);
+ $code = idx($parts, 3);
+ $name = idx($parts, 4);
+ $description = idx($parts, 5);
- if ($severity !== null) {
+ if (strlen($severity)) {
$message->setSeverity($severity);
}
- if ($line !== null) {
+ if (strlen($line)) {
$message->setLine($line);
}
- if ($char !== null) {
+ if (strlen($char)) {
$message->setChar($char);
}
- if ($code !== null) {
+ if (strlen($code)) {
$message->setCode($code);
}
+ if (strlen($name)) {
+ $message->setName($name);
+ }
+
+ if (strlen($description)) {
+ $message->setDescription($description);
+ }
+
$expected_results->addMessage($message);
}
@@ -246,6 +256,20 @@
continue;
}
+ if (!self::compareLintMessageProperty(
+ $expected_message->getName(),
+ $actual_message->getName())) {
+
+ continue;
+ }
+
+ if (!self::compareLintMessageProperty(
+ $expected_message->getDescription(),
+ $actual_message->getDescription())) {
+
+ continue;
+ }
+
$found = true;
unset($surprising[$ii]);
}
@@ -260,14 +284,15 @@
if ($missing) {
foreach ($missing as $message) {
$expected .= sprintf(
- "\n %s: %s %s",
+ "\n %s: %s %s: %s",
pht(
'%s at line %d, char %d',
$message->getSeverity(),
$message->getLine(),
$message->getChar()),
$message->getCode(),
- $message->getName());
+ $message->getName(),
+ $message->getDescription());
}
} else {
$expected .= "\n ".pht('No messages');
@@ -277,14 +302,15 @@
if ($surprising) {
foreach ($surprising as $message) {
$actual .= sprintf(
- "\n %s: %s %s",
+ "\n %s: %s %s: %s",
pht(
'%s at line %d, char %d',
$message->getSeverity(),
$message->getLine(),
$message->getChar()),
$message->getCode(),
- $message->getName());
+ $message->getName(),
+ $message->getDescription());
}
} else {
$actual .= "\n ".pht('No messages');
diff --git a/src/lint/linter/xhpast/rules/__tests__/variable-variable/variable-variables.lint-test b/src/lint/linter/xhpast/rules/__tests__/variable-variable/variable-variables.lint-test
--- a/src/lint/linter/xhpast/rules/__tests__/variable-variable/variable-variables.lint-test
+++ b/src/lint/linter/xhpast/rules/__tests__/variable-variable/variable-variables.lint-test
@@ -3,4 +3,4 @@
$$foo;
$obj->$bar; // okay
~~~~~~~~~~
-error:3:1:XHP3:Use of Variable
+error:3:1:XHP3:Use of Variable Variable
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 5, 10:43 AM (1 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6735998
Default Alt Text
D20532.id48962.diff (3 KB)
Attached To
Mode
D20532: Fix handling of empty line/column in linter tests
Attached
Detach File
Event Timeline
Log In to Comment