| Test :: class. Test :: Class è un modulo Perl che consente di creare facilmente lezioni di prova in uno stile XUnit / Junit. |
Scarica ora |
Test :: class. Classifica e riepilogo
- Licenza:
- Perl Artistic License
- Nome editore:
- Adrian Howard
- Sito web dell'editore:
- http://search.cpan.org/~adie/Test-Block-0.11/lib/Test/Block.pm
Test :: class. Tag
Test :: class. Descrizione
Test :: Class è un modulo perl che consente di creare facilmente lezioni di prova in uno stile XUnit / Junit. Test :: Class è un modulo Perl che consente di creare facilmente classi di prova in uno stile XUnit / Junit.Synopsis Package Exemet :: Test; usa la base QW (Test :: class); Usa Test :: altro; # I metodi di configurazione vengono eseguiti prima di ogni metodo di prova. Sub make_fixture: Test (Setup) {My $ array = ; Shift -> {test_array} = $ array; }; # Un metodo di prova che esegue 1 test sub test_push: test {my $ array = shift -> {test_array}; spingere @ $ array, 3; is_deeply ($ array, , "spingere lavorato"); }; # Un metodo di prova che esegue 4 test sub test_pop: test (4) {My $ array = shift -> {test_array}; è (Pop @ $ array, 2, 'pop = 2'); è (Pop @ $ array, 1, 'pop = 1'); is_deeply ($ array, [], 'array vuoto'); è (pop @ $ array, undef, 'pop = undef'); }; # I metodi di teatrodown vengono eseguiti dopo ogni metodo di prova. Sub Teardown: Test (Teardown) {My $ array = shift -> {test_array}; diag ("array = (@ $ array) dopo test (s)"); }; più tardi in un Nelle vicinanze .t file #! / usr / bin / perl uso Esempio :: test; # Esegui tutti i metodi di prova nell'esempio :: Test del test :: Class-> Runtests; Uscite: 1..5 OK 1 - Pop = 2 OK 2 - Pop = 1 OK 3 - Array vuoto OK 4 - Pop = Undef # Array = () After Test (s) OK 5 - PUSH funzionava # array = (12 3) DOPO I requisiti dei test: · Perl.
Test :: class. Software correlato