| 1 | #!/usr/bin/env perl |
| 2 | |
| 3 | use strictscip-perl cpan Catmandu 1.2025 strict/; |
| 4 | use warningsscip-perl cpan Catmandu 1.2025 warnings/; |
| 5 | use Test::Morescip-perl cpan Catmandu 1.2025 Test/More/; |
| 6 | use Test::Exceptionscip-perl cpan Catmandu 1.2025 Test/Exception/; |
| 7 | |
| 8 | my $pkg; |
| 9 | |
| 10 | BEGIN { |
| 11 | $pkg = 'Catmandu::Fix::lookup'; |
| 12 | use_okscip-perl cpan Catmandu 1.2025 main/use_ok(). $pkg; |
| 13 | } |
| 14 | |
| 15 | is_deeplyscip-perl cpan Catmandu 1.2025 main/is_deeply(). $pkg->newscip-perl cpan Catmandu 1.2025 main/new().('planet', 't/planets.csv')->fixscip-perl cpan Catmandu 1.2025 main/fix().({planet => 'Earth'}), |
| 16 | {planet => 'Terra'}; |
| 17 | |
| 18 | is_deeplyscip-perl cpan Catmandu 1.2025 main/is_deeply(). $pkg->newscip-perl cpan Catmandu 1.2025 main/new().('planet', 't/planets.csv')->fixscip-perl cpan Catmandu 1.2025 main/fix().({planet => 'Bartledan'}), |
| 19 | {planet => 'Bartledan'}; |
| 20 | |
| 21 | is_deeplyscip-perl cpan Catmandu 1.2025 main/is_deeply(). $pkg->newscip-perl cpan Catmandu 1.2025 main/new().('planet', 't/planets.csv', 'delete', 1) |
| 22 | ->fixscip-perl cpan Catmandu 1.2025 main/fix().({planet => 'Bartledan'}), {}; |
| 23 | |
| 24 | is_deeplyscip-perl cpan Catmandu 1.2025 main/is_deeply(). $pkg->newscip-perl cpan Catmandu 1.2025 main/new().('planets.*', 't/planets.csv', 'delete', 1) |
| 25 | ->fixscip-perl cpan Catmandu 1.2025 main/fix().({planets => ['Bartledan', 'Earth']}), {planets => ['Terra']}; |
| 26 | |
| 27 | is_deeplyscip-perl cpan Catmandu 1.2025 main/is_deeply(). $pkg->newscip-perl cpan Catmandu 1.2025 main/new().('planet', 't/planets.csv', 'default', 'Mars') |
| 28 | ->fixscip-perl cpan Catmandu 1.2025 main/fix().({planet => 'Bartledan'}), {planet => 'Mars'}; |
| 29 | |
| 30 | is_deeplyscip-perl cpan Catmandu 1.2025 main/is_deeply(). $pkg->newscip-perl cpan Catmandu 1.2025 main/new().('planets.*', 't/planets.csv', 'default', 'Mars') |
| 31 | ->fixscip-perl cpan Catmandu 1.2025 main/fix().({planets => ['Bartledan', 'Earth']}), |
| 32 | {planets => ['Mars', 'Terra']}, 'default with wildcard'; |
| 33 | |
| 34 | is_deeplyscip-perl cpan Catmandu 1.2025 main/is_deeply(). $pkg->newscip-perl cpan Catmandu 1.2025 main/new().('planet', 't/planets.tab', 'sep_char', "\t") |
| 35 | ->fixscip-perl cpan Catmandu 1.2025 main/fix().({planet => 'Earth'}), {planet => 'Terra'}, "pass csv options"; |
| 36 | |
| 37 | done_testing 8; |