Advertisement
Guest User

Untitled

a guest
Mar 13th, 2019
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.35 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3. use warnings;
  4. use strict;
  5.  
  6. use Test::More;
  7.  
  8. my %tests = (
  9.   'this is test one' => sub { $_[0] eq 'one' },
  10.   'this is test two' => sub { $_[0] eq 'two' },
  11. );
  12.  
  13. plan tests => scalar keys %tests;
  14.  
  15. foreach my $test ( keys %tests ) {
  16.     my $value = "one";
  17.     my $sub = $tests{$test};
  18.     my $res = $sub->($value);
  19.     ok( $res, $test );
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement