Skip to content

Commit cb34f82

Browse files
committed
Test for deprecation warning
1 parent a59e5b0 commit cb34f82

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

t/basic.t

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
use Data::Frame::Setup;
44

55
use Test2::V0;
6+
use Test2::Tools::Warnings qw/warning/;
67

78
use Data::Frame;
89
use PDL::Core qw(pdl);
@@ -33,7 +34,15 @@ is( $df_array->column_names, [ qw/z y x/ ] );
3334
is( $df_hash->column_names, [ qw/a b c/ ] );
3435

3536
is( $df_hash->column('c')->length, 4);
36-
is( $df_hash->column('c')->number_of_rows, 4);
37+
{
38+
my $length;
39+
like(
40+
warning { $length = $df_hash->column('c')->number_of_rows },
41+
qr/deprecated/,
42+
'Got deprecation warning'
43+
);
44+
is($length , 4);
45+
}
3746
is( $df_hash->column('c')->unpdl, $c);
3847

3948
like(

0 commit comments

Comments
 (0)