Skip to content

Commit

Permalink
fix matching the proofs to run
Browse files Browse the repository at this point in the history
  • Loading branch information
Baptouuuu committed Jun 29, 2024
1 parent 30e961d commit 433fb25
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
with:
dependency-versions: ${{ matrix.dependencies }}
- name: BlackBox
run: php blackbox.php all ${{ matrix.covers }}
run: php blackbox.php ${{ matrix.covers }}
env:
DB_PORT: ${{ job.services.mariadb.ports[3306] }}
ES_PORT: ${{ job.services.elasticsearch.ports[9200] }}
Expand Down
2 changes: 0 additions & 2 deletions blackbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@
};

enum Covers {
case all;
case filesystem;
case sql;
case elasticsearch;

public static function from(string $case): ?self
{
return match ($case) {
'all' => self::all,
'filesystem' => self::filesystem,
'sql' => self::sql,
'elasticsearch' => self::elasticsearch,
Expand Down
6 changes: 3 additions & 3 deletions proofs/id.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ static function($assert) {
->not()
->same(Id::new(stdClass::class)->toString());
},
)->tag(Covers::all);
)->tag(...Covers::cases());

yield proof(
'Id::equals()',
Expand All @@ -30,13 +30,13 @@ static function($assert, $a, $b) {
$assert->true($idA->equals($idABis));
$assert->false($idA->equals($idB));
},
)->tag(Covers::all);
)->tag(...Covers::cases());

yield proof(
'Id::of() throws on invalid values',
given(Set\Strings::madeOf(Set\Unicode::any())),
static function($assert, $value) {
$assert->throws(static fn() => Id::of(stdClass::class, $value));
},
)->tag(Covers::all);
)->tag(...Covers::cases());
};
6 changes: 3 additions & 3 deletions proofs/manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ static function($assert) {

$assert->same($repository1, $repository2);
},
)->tag(Covers::all);
)->tag(...Covers::cases());
yield test(
'Manager::repository() returns an instance per class',
static function($assert) {
Expand All @@ -57,7 +57,7 @@ static function($assert) {
->not()
->same($repositoryB);
},
)->tag(Covers::all);
)->tag(...Covers::cases());

yield test(
'Nested transactions are forbidden',
Expand All @@ -74,7 +74,7 @@ static function($assert) {
'Nested transactions not allowed',
);
},
)->tag(Covers::all);
)->tag(...Covers::cases());

yield properties(
'Filesystem properties',
Expand Down

0 comments on commit 433fb25

Please sign in to comment.