Skip to content

Commit 1d14ef2

Browse files
[4.x] Simplify RoundTest by parameterizing rounding precision and updating snapshots
- Combine separate rounding precision tests into a single parameterized test using datasets (`0`, `2`, `5`) - Update snapshot filenames to reflect dataset usage - Remove redundant test cases and unused snapshots
1 parent 9544adf commit 1d14ef2

5 files changed

Lines changed: 3 additions & 25 deletions

File tree

tests/.pest/snapshots/Unit/Result/ToConsoleTest/output.snap

Lines changed: 0 additions & 10 deletions
This file was deleted.

tests/.pest/snapshots/Unit/Round/RoundTest/to_0.snap renamed to tests/.pest/snapshots/Unit/Round/RoundTest/round_with_data_set___0__.snap

File renamed without changes.

tests/.pest/snapshots/Unit/Round/RoundTest/to_2.snap renamed to tests/.pest/snapshots/Unit/Round/RoundTest/round_with_data_set___2__.snap

File renamed without changes.

tests/.pest/snapshots/Unit/Round/RoundTest/to_5.snap renamed to tests/.pest/snapshots/Unit/Round/RoundTest/round_with_data_set___5__.snap

File renamed without changes.

tests/Unit/Round/RoundTest.php

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,8 @@
88
expectOutputToMatchSnapshot();
99
});
1010

11-
test('to 5', function () {
12-
benchmark()->round(5)->toConsole();
11+
test('round', function (int $precision) {
12+
benchmark()->round($precision)->toConsole();
1313

1414
expectOutputToMatchSnapshot();
15-
});
16-
17-
test('to 2', function () {
18-
benchmark()->round(2)->toConsole();
19-
20-
expectOutputToMatchSnapshot();
21-
});
22-
23-
test('to 0', function () {
24-
benchmark()->round(0)->toConsole();
25-
26-
expectOutputToMatchSnapshot();
27-
});
15+
})->with([0, 2, 5]);

0 commit comments

Comments
 (0)