| 1 | package Test::BDD::Infrastructure::Compare; | ||
| 2 | |||
| 3 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 1 | our $VERSION = '1.005'; # VERSION | |
| 7 | # ABSTRACT: cucumber step definitions for comparsion checks | ||
| 8 | |||
| 9 | 1 | ▶ | use Test::More; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | 1 | ▶ | use Test::BDD::Cucumber::StepFile qw( Given When Then ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | 0 | ▶ | sub S { Test::BDD::Cucumber::StepFile::S } |
|
Subroutine
S: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 13 | |||
| 14 | 1 | ▶ | use Test::BDD::Infrastructure::Utils qw( |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 15 | 1 | convert_cmp_operator $CMP_OPERATOR_RE lookup_config); | |
| 16 | |||
| 17 | 1 | ▶ | use File::Slurp; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 18 | |||
| 19 | |||
| 20 | 0 | ▶ | Then qr/the value (\S+) must be like (.*)/, sub { |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 21 | 0 | my $value = lookup_config( $1 ); | |
| 22 | 0 | my $regex = $2; | |
| 23 | 0 | like( $value, qr/$regex/, "the value $value must be like $regex"); | |
| 24 | 1 | }; | |
| 25 | 0 | ▶ | Then qr/the value (\S+) must be unlike (.*)/, sub { |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 26 | 0 | my $value = lookup_config( $1 ); | |
| 27 | 0 | my $regex = $2; | |
| 28 | 0 | unlike( $value, qr/$regex/, "the value $value must be unlike $regex"); | |
| 29 | 1 | }; | |
| 30 | |||
| 31 | 0 | ▶ | Then qr/the value (\S+) must be $CMP_OPERATOR_RE (.*)/, sub { |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 32 | 0 | my $value = lookup_config( $1 ); | |
| 33 | 0 | my $op = convert_cmp_operator( $2 ); | |
| 34 | 0 | my $count = $3; | |
| 35 | 0 | cmp_ok( $value, $op, $count, "the value $value $op $count"); | |
| 36 | 1 | }; | |
| 37 | |||
| 38 | 1 | 1; | |
| 39 | |||
| 40 | __END__ | ||