Skip to content

Commit 0276f49

Browse files
committed
support and require fbexpect 2.7.0+
1 parent 11d4f64 commit 0276f49

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

composer.json

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
],
3333
"type": "library",
3434
"require-dev": {
35+
"hhvm/fbexpect": "^2.7.0",
3536
"hhvm/hacktest": "^1.0",
3637
"hhvm/type-assert": "^3.1",
3738
"facebook/fbexpect": "^2.1.0",

tests/CodegenClassTest.hack

+7-7
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ final class CodegenClassTest extends CodegenBaseTest {
257257
$cgf = $this->getCodegenFactory();
258258
$code = $cgf->codegenClass('Foo')->setExtendsf('X<%s>', 'Y')->render();
259259

260-
expect($code)->toContain('extends X<Y>');
260+
expect($code)->toContainSubstring('extends X<Y>');
261261
}
262262

263263
public function testGenericsWithSubtypeConstraints(): void {
@@ -266,7 +266,7 @@ final class CodegenClassTest extends CodegenBaseTest {
266266
->addGenericSubtypeConstraint('T', 'U')
267267
->render();
268268

269-
expect($code)->toContain('T as U');
269+
expect($code)->toContainSubstring('T as U');
270270
}
271271

272272
public function testGenericsWithSuperTypeConstraints(): void {
@@ -275,7 +275,7 @@ final class CodegenClassTest extends CodegenBaseTest {
275275
->addGenericSupertypeConstraint('T', 'U')
276276
->render();
277277

278-
expect($code)->toContain('T super U');
278+
expect($code)->toContainSubstring('T super U');
279279
}
280280

281281
public function testGenericsWithConstraints(): void {
@@ -288,9 +288,9 @@ final class CodegenClassTest extends CodegenBaseTest {
288288
->addGeneric('Tsingle')
289289
->render();
290290

291-
expect($code)->toContain('Tk as Tv');
292-
expect($code)->toContain('Tu super Sp');
293-
expect($code)->toContain('Tt as Xx');
294-
expect($code)->toContain('Tsingle');
291+
expect($code)->toContainSubstring('Tk as Tv');
292+
expect($code)->toContainSubstring('Tu super Sp');
293+
expect($code)->toContainSubstring('Tt as Xx');
294+
expect($code)->toContainSubstring('Tsingle');
295295
}
296296
}

tests/CodegenFileTest.hack

+3-3
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ final class CodegenFileTest extends CodegenBaseTest {
315315
->setFileType(CodegenFileType::HACK_STRICT)
316316
->setShebangLine('#!/usr/bin/env hhvm')
317317
->render(),
318-
)->toThrow(\HH\InvariantException::class);
318+
)->toThrow(InvariantException::class);
319319
}
320320

321321
public function testDotHackExecutable(): void {
@@ -341,7 +341,7 @@ final class CodegenFileTest extends CodegenBaseTest {
341341
->setFileType(CodegenFileType::HACK_STRICT)
342342
->setPseudoMainHeader('exit();')
343343
->render(),
344-
)->toThrow(\HH\InvariantException::class);
344+
)->toThrow(InvariantException::class);
345345
}
346346

347347
public function testNoPseudoMainFooterInStrict(): void {
@@ -351,7 +351,7 @@ final class CodegenFileTest extends CodegenBaseTest {
351351
->setFileType(CodegenFileType::HACK_STRICT)
352352
->setPseudoMainFooter('exit();')
353353
->render(),
354-
)->toThrow(\HH\InvariantException::class);
354+
)->toThrow(InvariantException::class);
355355
}
356356

357357
public function testFormattingFullyGeneratedFile(): void {

tests/HackBuilderTest.hack

+2-2
Original file line numberDiff line numberDiff line change
@@ -373,8 +373,8 @@ $del."extends SomeBaseClass",
373373
HackBuilderValues::vector(HackBuilderValues::export()),
374374
)
375375
->getCode();
376-
expect($body)->toContain('Vector');
377-
expect($body)->toNotContain('HH');
376+
expect($body)->toContainSubstring('Vector');
377+
expect($body)->toNotContainSubstring('HH');
378378
expect_with_context(static::class, $body)->toBeUnchanged();
379379
}
380380

0 commit comments

Comments
 (0)