in reply to Testing Perl files rather than modules
Perl doesn't have "include", but it has "use" and "require"
#!/usr/bin/perl #script.pl use strict; use warnings; sub hello { return "Hello, World!\n" } 1; #!/usr/bin/perl #test.t use strict; use warnings; use Test::More tests => 2; require_ok("script.pl"); #tests 'require "script.pl" is(hello(), "Hello, World!\n", 'hello() should return "Hello, World!"'
Stop saying 'script'. Stop saying 'line-noise'.
We have nothing to lose but our metaphors.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Testing Perl files rather than modules
by Erez (Priest) on Sep 17, 2008 at 07:55 UTC | |
by jvector (Friar) on Sep 17, 2008 at 23:30 UTC |