mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
feat: compact dataset descriptions
This commit is contained in:
@ -23,7 +23,7 @@ it('show the actual dataset of non-named datasets in their description', functio
|
||||
], __FILE__));
|
||||
|
||||
expect($descriptions[0])->toBe('(1)');
|
||||
expect($descriptions[1])->toBe('(array(2))');
|
||||
expect($descriptions[1])->toBe('([2])');
|
||||
});
|
||||
|
||||
it('show only the names of multiple named datasets in their description', function () {
|
||||
@ -57,9 +57,9 @@ it('show the actual dataset of multiple non-named datasets in their description'
|
||||
], __FILE__));
|
||||
|
||||
expect($descriptions[0])->toBe('(1) / (3)');
|
||||
expect($descriptions[1])->toBe('(1) / (array(4))');
|
||||
expect($descriptions[2])->toBe('(array(2)) / (3)');
|
||||
expect($descriptions[3])->toBe('(array(2)) / (array(4))');
|
||||
expect($descriptions[1])->toBe('(1) / ([4])');
|
||||
expect($descriptions[2])->toBe('([2]) / (3)');
|
||||
expect($descriptions[3])->toBe('([2]) / ([4])');
|
||||
});
|
||||
|
||||
it('show the correct description for mixed named and not-named datasets', function () {
|
||||
@ -76,6 +76,26 @@ it('show the correct description for mixed named and not-named datasets', functi
|
||||
|
||||
expect($descriptions[0])->toBe('data set "one" / (3)');
|
||||
expect($descriptions[1])->toBe('data set "one" / data set "four"');
|
||||
expect($descriptions[2])->toBe('(array(2)) / (3)');
|
||||
expect($descriptions[3])->toBe('(array(2)) / data set "four"');
|
||||
expect($descriptions[2])->toBe('([2]) / (3)');
|
||||
expect($descriptions[3])->toBe('([2]) / data set "four"');
|
||||
});
|
||||
|
||||
it('shows the correct description for long texts with newlines', function () {
|
||||
$descriptions = array_keys(DatasetsRepository::resolve([
|
||||
[
|
||||
['some very \nlong text with \n newlines'],
|
||||
],
|
||||
], __FILE__));
|
||||
|
||||
expect($descriptions[0])->toBe('(\'some very long text with …wlines\')');
|
||||
});
|
||||
|
||||
it('shows the correct description for arrays with many elements', function () {
|
||||
$descriptions = array_keys(DatasetsRepository::resolve([
|
||||
[
|
||||
[[1, 2, 3, 4, 5]],
|
||||
],
|
||||
], __FILE__));
|
||||
|
||||
expect($descriptions[0])->toBe('([1, 2, 3, …])');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user