From 04aec5adde93ec92d8f6ce17b849648864a5284a Mon Sep 17 00:00:00 2001 From: Abigail Date: Mon, 1 Feb 2021 22:52:26 +0100 Subject: Test to compare the size of the program with the size of the (expected) output. --- challenge-004/abigail/t/Check_Program_Size.pm | 23 +++++++++++++++++++++++ challenge-004/abigail/t/ctest.ini | 5 ++++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100755 challenge-004/abigail/t/Check_Program_Size.pm diff --git a/challenge-004/abigail/t/Check_Program_Size.pm b/challenge-004/abigail/t/Check_Program_Size.pm new file mode 100755 index 0000000000..30369444d6 --- /dev/null +++ b/challenge-004/abigail/t/Check_Program_Size.pm @@ -0,0 +1,23 @@ +package Check_Program_Size; + +use 5.032; + +use strict; +use warnings; +no warnings 'syntax'; + +use experimental 'signatures'; +use experimental 'lexical_subs'; + +use Test::More; + +my $output = "t/output-1-1.exp"; + +sub test ($self, %args) { + my $source = $args {source}; + is -s $source, (-s $output) - 1, "Program size"; +} + +1; + +__END__ diff --git a/challenge-004/abigail/t/ctest.ini b/challenge-004/abigail/t/ctest.ini index 110f4abcc4..738fce6d3f 100644 --- a/challenge-004/abigail/t/ctest.ini +++ b/challenge-004/abigail/t/ctest.ini @@ -1,5 +1,5 @@ [names] -1-1 = Pi, 1485 digits +1-1 = Pi, 3242 digits 1-2 = Pi, 1978 digits @@ -12,3 +12,6 @@ skip = Program size is different [1-2/perl] skip = Program size is different + +[challenges/1] +extra_tests = Check_Program_Size -- cgit