From 19424ae06d137f0f73a8af62334638021a5a835b Mon Sep 17 00:00:00 2001 From: Dan Ang Date: Fri, 24 Mar 2023 16:00:33 +0100 Subject: [PATCH] fix inconsistency in dataset spelling --- overrides/Runner/Filter/NameFilterIterator.php | 6 +++--- src/Repositories/DatasetsRepository.php | 2 +- tests/.snapshots/success.txt | 16 ++++++++-------- tests/Unit/DatasetsTests.php | 18 +++++++++--------- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/overrides/Runner/Filter/NameFilterIterator.php b/overrides/Runner/Filter/NameFilterIterator.php index 323e0aa1..391c3ed5 100644 --- a/overrides/Runner/Filter/NameFilterIterator.php +++ b/overrides/Runner/Filter/NameFilterIterator.php @@ -107,7 +107,7 @@ final class NameFilterIterator extends RecursiveFilterIterator if (preg_match('/^(.*?)#(\d+)(?:-(\d+))?$/', $filter, $matches)) { if (isset($matches[3]) && $matches[2] < $matches[3]) { $filter = sprintf( - '%s.*with data set #(\d+)$', + '%s.*with dataset #(\d+)$', $matches[1] ); @@ -115,7 +115,7 @@ final class NameFilterIterator extends RecursiveFilterIterator $this->filterMax = (int) $matches[3]; } else { $filter = sprintf( - '%s.*with data set #%s$', + '%s.*with dataset #%s$', $matches[1], $matches[2] ); @@ -125,7 +125,7 @@ final class NameFilterIterator extends RecursiveFilterIterator // * testDetermineJsonError@JSON.* elseif (preg_match('/^(.*?)@(.+)$/', $filter, $matches)) { $filter = sprintf( - '%s.*with data set "%s"$', + '%s.*with dataset "%s"$', $matches[1], $matches[2] ); diff --git a/src/Repositories/DatasetsRepository.php b/src/Repositories/DatasetsRepository.php index c44d5df0..07c4a42c 100644 --- a/src/Repositories/DatasetsRepository.php +++ b/src/Repositories/DatasetsRepository.php @@ -235,6 +235,6 @@ final class DatasetsRepository return sprintf('(%s)', $exporter->shortenedRecursiveExport($data)); } - return sprintf('data set "%s"', $key); + return sprintf('dataset "%s"', $key); } } diff --git a/tests/.snapshots/success.txt b/tests/.snapshots/success.txt index 26d83759..347a236b 100644 --- a/tests/.snapshots/success.txt +++ b/tests/.snapshots/success.txt @@ -60,8 +60,8 @@ ✓ eager wrapped registered datasets with (1) ✓ eager wrapped registered datasets with (2) ✓ eager registered wrapped datasets did the job right - ✓ named datasets with data set "one" - ✓ named datasets with data set "two" + ✓ named datasets with dataset "one" + ✓ named datasets with dataset "two" ✓ named datasets did the job right ✓ lazy named datasets with (Bar Object (…)) ✓ it creates unique test case names with ('Name 1', Pest\Plugin Object (), true) #1 @@ -96,10 +96,10 @@ ✓ eager wrapped registered multiple datasets with (2) / (1) ✓ eager wrapped registered multiple datasets with (2) / (2) ✓ eager wrapped registered multiple datasets did the job right - ✓ named multiple datasets with data set "one" / data set "three" - ✓ named multiple datasets with data set "one" / data set "four" - ✓ named multiple datasets with data set "two" / data set "three" - ✓ named multiple datasets with data set "two" / data set "four" + ✓ named multiple datasets with dataset "one" / dataset "three" + ✓ named multiple datasets with dataset "one" / dataset "four" + ✓ named multiple datasets with dataset "two" / dataset "three" + ✓ named multiple datasets with dataset "two" / dataset "four" ✓ named multiple datasets did the job right ✓ more than two datasets with (1) / (3) / (5) ✓ more than two datasets with (1) / (3) / (6) @@ -115,8 +115,8 @@ ✓ eager registered wrapped datasets with Generator functions with (3) ✓ eager registered wrapped datasets with Generator functions with (4) ✓ eager registered wrapped datasets with Generator functions did the job right - ✓ eager registered wrapped datasets with Generator functions display description with data set "taylor" - ✓ eager registered wrapped datasets with Generator functions display description with data set "james" + ✓ eager registered wrapped datasets with Generator functions display description with dataset "taylor" + ✓ eager registered wrapped datasets with Generator functions display description with dataset "james" ✓ it can resolve a dataset after the test case is available with (Closure Object (…)) #1 ✓ it can resolve a dataset after the test case is available with (Closure Object (…)) #2 ✓ it can resolve a dataset after the test case is available with multiple datasets with (Closure Object (…)) / (Closure Object (…)) #1 diff --git a/tests/Unit/DatasetsTests.php b/tests/Unit/DatasetsTests.php index 63653f5b..79cc44a6 100644 --- a/tests/Unit/DatasetsTests.php +++ b/tests/Unit/DatasetsTests.php @@ -10,8 +10,8 @@ it('show only the names of named datasets in their description', function () { ], ], __FILE__)); - expect($descriptions[0])->toBe('data set "one"') - ->and($descriptions[1])->toBe('data set "two"'); + expect($descriptions[0])->toBe('dataset "one"') + ->and($descriptions[1])->toBe('dataset "two"'); }); it('show the actual dataset of non-named datasets in their description', function () { @@ -38,10 +38,10 @@ it('show only the names of multiple named datasets in their description', functi ], ], __FILE__)); - expect($descriptions[0])->toBe('data set "one" / data set "three"'); - expect($descriptions[1])->toBe('data set "one" / data set "four"'); - expect($descriptions[2])->toBe('data set "two" / data set "three"'); - expect($descriptions[3])->toBe('data set "two" / data set "four"'); + expect($descriptions[0])->toBe('dataset "one" / dataset "three"'); + expect($descriptions[1])->toBe('dataset "one" / dataset "four"'); + expect($descriptions[2])->toBe('dataset "two" / dataset "three"'); + expect($descriptions[3])->toBe('dataset "two" / dataset "four"'); }); it('show the actual dataset of multiple non-named datasets in their description', function () { @@ -74,10 +74,10 @@ it('show the correct description for mixed named and not-named datasets', functi ], ], __FILE__)); - expect($descriptions[0])->toBe('data set "one" / (3)'); - expect($descriptions[1])->toBe('data set "one" / data set "four"'); + expect($descriptions[0])->toBe('dataset "one" / (3)'); + expect($descriptions[1])->toBe('dataset "one" / dataset "four"'); expect($descriptions[2])->toBe('([2]) / (3)'); - expect($descriptions[3])->toBe('([2]) / data set "four"'); + expect($descriptions[3])->toBe('([2]) / dataset "four"'); }); it('shows the correct description for long texts with newlines', function () {