]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Add a test case for false negative switch lint rule
authorvrana <jakubv@fb.com>
Thu, 6 Sep 2012 22:13:18 +0000 (15:13 -0700)
committervrana <jakubv@fb.com>
Fri, 7 Sep 2012 22:55:34 +0000 (15:55 -0700)
Summary:
I tried to fixed it but I've given up.

See rP958e6cd109f3.

Test Plan:
  $ arc unit

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D3449

src/lint/linter/__tests__/xhpast/switches.lint-test

index e0420516b5e0558ddce04616184ae691944cc477..57c4a2efe717d432fd93b8e4df88e58bbc0460cd 100644 (file)
@@ -48,6 +48,22 @@ switch ($x) {
   default:
     $x++;
 }
+
+switch ($x) {
+  case 1:
+    while (true) {
+      break;
+    }
+    // TODO: false negative
+  case 2:
+    switch ($y) {
+      case 1:
+        break;
+    }
+    // TODO: false negative
+}
 ~~~~~~~~~~
 warning:41:3
 warning:48:3
+disabled:57:8
+disabled:63:8