Skip to content
This repository has been archived by the owner on Dec 1, 2024. It is now read-only.

Commit

Permalink
Don't run instanceof test on 4.17
Browse files Browse the repository at this point in the history
  • Loading branch information
fredemmott committed Aug 1, 2019
1 parent 055bff0 commit 82ac0e7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tests/UnusedUseClauseLinterTest.hack
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

namespace Facebook\HHAST;

use namespace HH\Lib\Vec;

final class UnusedUseClauseLinterTest extends TestCase {
use AutoFixingLinterTestTrait<ASTLintError>;

Expand All @@ -17,9 +19,8 @@ final class UnusedUseClauseLinterTest extends TestCase {
}

public function getCleanExamples(): vec<(string)> {
return vec[
$base = vec[
tuple("<?hh\nuse type Foo; Foo::bar();"),
tuple("<?hh\nuse type Foo; \$x instanceof Foo;"),
tuple("<?hh\nuse type Foo; function bar<T as Foo>(): void {}"),
tuple("<?hh\nuse type Foo; class Bar<T as Foo>{}"),
tuple("<?hh\nuse type Foo; new Foo();"),
Expand All @@ -32,5 +33,12 @@ final class UnusedUseClauseLinterTest extends TestCase {
tuple("<?hh\nuse function foo; foo();"),
tuple("<?hh\nuse const FOO; var_dump(FOO);"),
];

if (\HHVM_VERSION_ID >= 41700) {
return $base;
}
return Vec\concat($base, vec[
tuple("<?hh\nuse type Foo; \$x instanceof Foo;"),
]);
}
}

0 comments on commit 82ac0e7

Please sign in to comment.