summaryrefslogtreecommitdiff
path: root/test/t
diff options
context:
space:
mode:
Diffstat (limited to 'test/t')
-rw-r--r--test/t/00-basic.t9
-rwxr-xr-xtest/t/samples/foo2
-rw-r--r--test/t/samples/src/.directory0
3 files changed, 10 insertions, 1 deletions
diff --git a/test/t/00-basic.t b/test/t/00-basic.t
index 99a3e5fbd..ae8eff77d 100644
--- a/test/t/00-basic.t
+++ b/test/t/00-basic.t
@@ -5,7 +5,7 @@ use Test::Exception;
use lib 'lib';
use_ok 'Exim::Runtest', qw(:all) or BAIL_OUT 'Can not load the module';
-can_ok 'Exim::Runtest', qw(mailgroup dynamic_socket);
+can_ok 'Exim::Runtest', qw(mailgroup dynamic_socket exim_binary);
pod_coverage_ok 'Exim::Runtest' => 'docs complete';
subtest 'mailgroup' => sub {
@@ -31,5 +31,12 @@ subtest 'dynamic_socket' => sub {
$socket->close;
};
+subtest 'exim_binary' => sub {
+ my @argv1 = qw(/bin/sh a b);
+ my @argv2 = qw(t/samples/foo a b);
+ chomp(my $cwd = `pwd`); # don't use Cwd, as we use Cwd in the tested module already
+ is_deeply [exim_binary(@argv1)], \@argv1 => 'got the binary as abs path from argv';
+ is_deeply [exim_binary(@argv2)], ["$cwd/t/samples/foo", @argv2[1,$#argv2]] => 'got the binary as rel path from argv';
+};
done_testing;
diff --git a/test/t/samples/foo b/test/t/samples/foo
new file mode 100755
index 000000000..0e748db3f
--- /dev/null
+++ b/test/t/samples/foo
@@ -0,0 +1,2 @@
+# this file solely exists to be tested as
+# an executable from one of the tests in t/
diff --git a/test/t/samples/src/.directory b/test/t/samples/src/.directory
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/test/t/samples/src/.directory