forked from hhvm/hhast
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUnusedLambdaParameterLinterTest.hack
More file actions
34 lines (30 loc) · 1.15 KB
/
UnusedLambdaParameterLinterTest.hack
File metadata and controls
34 lines (30 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
* Copyright (c) 2017-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
namespace Facebook\HHAST;
final class UnusedLambdaParameterLinterTest extends TestCase {
use AutoFixingLinterTestTrait<ASTLintError>;
<<__Override>>
protected function getLinter(string $file): UnusedLambdaParameterLinter {
return UnusedLambdaParameterLinter::fromPath($file);
}
<<__Override>>
public function getCleanExamples(): vec<(string)> {
return vec[
tuple('<?hh function _(): void {$x ==> $x + 1;}'),
tuple('<?hh function _(): void {($x) ==> $x + 1;}'),
tuple('<?hh function _(): void {(... $xs) ==> C\count($xs);}'),
tuple('<?hh function _(): void {$_unused ==> 0;}'),
tuple('<?hh function _(): void {($_unused) ==> 0;}'),
tuple('<?hh function _(): void {(... $_unused) ==> 0;}'),
tuple('<?hh function _(): void {$x ==> $y ==> $x + $y;}'),
tuple('<?hh function _(): void {$x ==> $_y ==> $z ==> $x + $z;}'),
tuple('<?hh function _(): void {$x ==> { return $x; };}'),
];
}
}