summaryrefslogtreecommitdiff
path: root/src/test/perl/TestLib.pm
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/perl/TestLib.pm')
-rw-r--r--src/test/perl/TestLib.pm14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/perl/TestLib.pm b/src/test/perl/TestLib.pm
index 51b533e08c..31e7acd4da 100644
--- a/src/test/perl/TestLib.pm
+++ b/src/test/perl/TestLib.pm
@@ -20,6 +20,7 @@ use SimpleTee;
use Test::More;
our @EXPORT = qw(
+ generate_ascii_string
slurp_dir
slurp_file
append_to_file
@@ -166,6 +167,19 @@ sub run_log
return IPC::Run::run(@_);
}
+# Generate a string made of the given range of ASCII characters
+sub generate_ascii_string
+{
+ my ($from_char, $to_char) = @_;
+ my $res;
+
+ for my $i ($from_char .. $to_char)
+ {
+ $res .= sprintf("%c", $i);
+ }
+ return $res;
+}
+
sub slurp_dir
{
my ($dir) = @_;