File: 08-unit.t

package info (click to toggle)
libscriptalicious-perl 1.15-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 180 kB
  • ctags: 70
  • sloc: perl: 1,150; makefile: 16
file content (17 lines) | stat: -rw-r--r-- 425 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/perl -w
#

use Test::More no_plan;
BEGIN { use_ok( "Scriptalicious" ) };

open POD, "<blib/lib/Scriptalicious.pod" or die $!;
my @data = grep { /^ time_unit/..!/^ time_unit/ } <POD>;
close POD;

ok(@data, "sanity - found examples in the man page");

for (@data) {
   next unless /\S/;
   my ($input, $return) = m{\(([^)]+)\)\s*=>\s*"([^"]+)"} or die;
   is(time_unit(eval $input), $return, "time_unit($input)");
}