diff --git a/.gitignore b/.gitignore index 3e04db63..fb4082bb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ vendor/ +*.hhast.parser-cache *.swp *~ composer.lock diff --git a/src/lies_we_tell_hack.hhi b/src/lies_we_tell_hack.hhi deleted file mode 100644 index 97016d0f..00000000 --- a/src/lies_we_tell_hack.hhi +++ /dev/null @@ -1,21 +0,0 @@ - = \KeyedContainer; -} - -namespace { - const POSIX_S_IFMT = 0; - const POSIX_S_IFREG = 0; - const POSIX_S_IFDIR = 0; - const POSIX_S_IFLNK = 0; -} diff --git a/tests/regex/RegexTest.php b/tests/regex/RegexTest.php index 9ff8b172..4f562d09 100644 --- a/tests/regex/RegexTest.php +++ b/tests/regex/RegexTest.php @@ -13,7 +13,6 @@ use function Facebook\FBExpect\expect; // @oss-enable use type Facebook\HackTest\{DataProvider, HackTest}; // @oss-enable -use type HH\InvariantException as InvariantViolationException; // @oss-enable // @oss-disable: <> final class RegexTest extends HackTest { @@ -25,13 +24,15 @@ public static function checkThrowsOnInvalidOffset( expect(() ==> $fn('Hello', re"/Hello/", -5))->notToThrow(); expect(() ==> $fn('Hello', re"/Hello/", 6))-> toThrow( - InvariantViolationException::class, + InvariantException::class, // @oss-enable + // @oss-disable: InvariantViolationException::class, null, 'Invalid offset should throw an exception', ); expect(() ==> $fn('Hello', re"/Hello/", -6))-> toThrow( - InvariantViolationException::class, + InvariantException::class, // @oss-enable + // @oss-disable: InvariantViolationException::class, null, 'Invalid offset should throw an exception', ); @@ -375,8 +376,10 @@ public function testSplit( } public function testSplitInvalidLimit(): void { - expect(() ==> Regex\split('hello world', re"/x/", 1)) - ->toThrow(InvariantViolationException::class); + expect(() ==> Regex\split('hello world', re"/x/", 1))->toThrow( + InvariantException::class, // @oss-enable + // @oss-disable: InvariantViolationException::class, + ); } public static function provideToString(