Skip to content
This repository was archived by the owner on Aug 1, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// For format details, see https://aka.ms/devcontainer.json.
{
"name": "Hack",
"runArgs": [
"--init"
],
"image": "hhvm/hhvm:latest",

// Set *default* container specific settings.json values on container create.
"userEnvProbe": "loginShell",

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"pranayagarwal.vscode-hack"
],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer && composer install"

}
2 changes: 1 addition & 1 deletion src/Constraint/IsType.hack
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Facebook\FBExpect\Constraint;

use function Facebook\FBExpect\is_iterable;

class IsType {
final class IsType {
const type TPredicate = (function(mixed): bool);
public function __construct(private string $expectedType) {}

Expand Down
2 changes: 1 addition & 1 deletion src/Constraint/TraversableContains.hack
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace Facebook\FBExpect\Constraint;

class TraversableContains {
final class TraversableContains {

public function __construct(private mixed $value) {}

Expand Down
2 changes: 1 addition & 1 deletion src/ExpectObj.hack
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use namespace HH\Lib\{C, Str, Vec};
use type HH\Lib\Ref;
use type Facebook\HackTest\ExpectationFailedException;

class ExpectObj<T> extends Assert {
final class ExpectObj<T> extends Assert {
public function __construct(private T $var) {}

/**************************************
Expand Down
5 changes: 2 additions & 3 deletions tests/ExpectObjTest.hack
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ final class ExpectObjTest extends HackTest {
expect('haystack')->toNotMatchRegExp('/needle/');

// sorting
expect(vec[1, 2, 3])->toBeSortedBy(function(int $prev, int $curr): bool {
expect(vec[1, 2, 3])->toBeSortedBy((int $prev, int $curr): bool ==> {
if ($prev <= $curr) {
return true;
}
Expand Down Expand Up @@ -218,7 +218,6 @@ final class ExpectObjTest extends HackTest {
} else {
expect(() ==> $rm->invokeArgs($obj, vec[$expected, 'custom msg']))
->toThrow(ExpectationFailedException::class, 'custom msg');
;
}

// And with funky sprintfification
Expand Down Expand Up @@ -248,7 +247,7 @@ final class ExpectObjTest extends HackTest {
//
public function testToThrowWithMessage(): void {
expect(
function() {
() ==> {
expect(
() ==> {
throw new ExpectObjTestException('test 2');
Expand Down