Debian Codegraph @

t/regressions/010_greedy_table_parsing/test_steps.pl

raw symbols SCIP
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5 use Test::More;
6 use Test::BDD::Cucumber::StepFile;
7 use Digest::MD5;
8
9 Given qr/a Digest MD5 object/, sub {
10 S->{digest} = Digest::MD5->new;
11 };
12
13 When qr/I add "([^"]+)" to the object/, sub {
14 S->{digest}->add( C->matches->[0] );
15 };
16
17 Then qr/the results look like/, sub {
18 my $data = C->data;
19 my $digest = S->{digest};
20 foreach my $row ( @{$data} ) {
21 my $func = $row->{method};
22 my $expect = $row->{output};
23 my $got = $digest->$func();
24 is $got, $expect, "test: $func";
25 }
26 };
27
28 Then qr/the ((?:hex|b64)digest) looks like:/, sub {
29 my $func = $1;
30 my $expect = C->data;
31 chomp $expect;
32 my $digest = S->{digest};
33 my $got = $digest->$func();
34 is $got, $expect, "test: $func";
35 };