diff options
author | Russ Allbery <rra@cpan.org> | 2022-01-18 22:03:59 -0800 |
---|---|---|
committer | Russ Allbery <rra@cpan.org> | 2022-01-18 22:03:59 -0800 |
commit | 0a89695fb71cc15bd34b82a9ed7f59d804153293 (patch) | |
tree | 861b57ddc90839957872798790e7fa4dd5162152 | |
parent | cb5db70173342201829c4c90eadb614fceb0a57c (diff) |
Improve t/update/spin.t Git analysis
Use git status -s for the t/update/spin.t test to stop it from
being sensitive to locales, and to make the test logic simpler.
-rwxr-xr-x | t/update/spin.t | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/t/update/spin.t b/t/update/spin.t index c692c80..d2bbc5a 100755 --- a/t/update/spin.t +++ b/t/update/spin.t @@ -46,20 +46,16 @@ $update->update_spin($tempdir); # Check the resulting output. my $expected = path('t', 'data', 'spin', 'update', 'output'); my $count = is_spin_output_tree("$tempdir", "$expected", 'Tree updated'); -my @changes = grep { m{ deleted | new [ ] file }xms } $repo->run('status'); -@changes = map { [split(q{ })] } sort(@changes); -is_deeply( - \@changes, - [ - ['deleted:', 'module.rpod'], - ['deleted:', 'readme.rpod'], - ['deleted:', 'script.rpod'], - ['new', 'file:', 'module.spin'], - ['new', 'file:', 'readme.spin'], - ['new', 'file:', 'script.spin'], - ], - 'Git operations', +my @status = sort $repo->run('status', '-s'); +my @changes = ( + 'A module.spin', + 'A readme.spin', + 'A script.spin', + 'D module.rpod', + 'D readme.rpod', + 'D script.rpod', ); +is_deeply(\@status, \@changes, 'Git operations'); # Report the end of testing. done_testing($count + 2); |