From 339cabedcc39a8d2845656c412287cdfc8735de5 Mon Sep 17 00:00:00 2001 From: vrana Date: Thu, 6 Sep 2012 15:13:18 -0700 Subject: [PATCH] Add a test case for false negative switch lint rule 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 --- .../linter/__tests__/xhpast/switches.lint-test | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/lint/linter/__tests__/xhpast/switches.lint-test b/src/lint/linter/__tests__/xhpast/switches.lint-test index e0420516..57c4a2ef 100644 --- a/src/lint/linter/__tests__/xhpast/switches.lint-test +++ b/src/lint/linter/__tests__/xhpast/switches.lint-test @@ -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 -- 2.43.0