commit 630dd8f3688b205ae8dd03f6718673db8add0504
parent 9903a80b2b6b5ce1f606a391ed381ad5bebf1566
Author: Kyle Milz <kyle@0x30.net>
Date: Mon, 29 Aug 2016 22:11:47 -0600
test: push hash references and not bare hashes
Diffstat:
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/t/rt_translunit.t b/t/rt_translunit.t
@@ -10,15 +10,15 @@ use test::shm;
my $test_prog = Test::Cmd->new( prog => 'test/program', workdir => '');
$test_prog->run( args => "10" );
-is $? >> 8, 0, 'did test program exit 0';
+is $? >> 8, 0, 'is test program exit code 0';
my $shm = test::shm->new();
-my (%tu1, %tu2, %tu3) = @{ $shm->{translation_units} };
-is $tu1{size}, 26, "transl unit 1 size";
-cmp_ok $tu1{cmp_sz}, '<', 1024, 'is size of compiler file name less than 1024';
-cmp_ok $tu1{cmp_sz}, '>', 0, 'is size of compiler file name greater than 0';
-#is $tu1{comp_file_name}, 'one.c', 'is compiler file name right';
-cmp_ok $tu1{abs_sz}, '<', 1024, 'is size of absolute file path less than 1024';
-cmp_ok $tu1{abs_sz}, '>', 0, 'is size of absolute file path greater than 0';
-like $tu1{abs_file_path}, qr/.*one.c/, 'is absolute file path believable';
+my ($tu1, $tu2, $tu3) = @{ $shm->{translation_units} };
+is $tu1->{size}, 9, "is transl unit 1 9 lines";
+cmp_ok $tu1->{cmp_sz}, '<', 1024, 'is size of compiler file name less than 1024';
+cmp_ok $tu1->{cmp_sz}, '>', 0, 'is size of compiler file name greater than 0';
+#is $tu1->{comp_file_name}, 'three.c', 'is compiler file name right';
+cmp_ok $tu1->{abs_sz}, '<', 1024, 'is size of absolute file path less than 1024';
+cmp_ok $tu1->{abs_sz}, '>', 0, 'is size of absolute file path greater than 0';
+like $tu1->{abs_file_path}, qr/.*three.c/, 'is absolute file path believable';
diff --git a/test/shm.pm b/test/shm.pm
@@ -39,7 +39,7 @@ sub new {
xread($fh, $tu{size} * 8);
$self->next_page();
- push @translation_units, (%tu);
+ push @translation_units, (\%tu);
}
$self->{translation_units} = \@translation_units;