summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2020-02-08 00:14:10 -0700
committerSean Whitton <spwhitton@spwhitton.name>2020-02-08 00:14:10 -0700
commit2a1c7ef7c020dd3ed47ed18f28f3ce8f9dad9c79 (patch)
tree6ee6fbf4dca686721b29e92e8358eeef4290e89e /t
parent335ce93a4ae9c97ebdb22a3f0349796ef3654c3f (diff)
downloadp5-Git-Annex-2a1c7ef7c020dd3ed47ed18f28f3ce8f9dad9c79.tar.gz
option to populate @ARGV using an anonymous array
Now Perl code can call our App:: code and simulate command line arguments by passing an arrayref. Note that we can't just say local @ARGV = @_ if @_; because then we can't distinguish between the intent to simulate passing zero command line arguments and a request to look to @ARGV. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 't')
-rwxr-xr-xt/21_annex-to-annex.t5
1 files changed, 4 insertions, 1 deletions
diff --git a/t/21_annex-to-annex.t b/t/21_annex-to-annex.t
index 76ddd27..9589b59 100755
--- a/t/21_annex-to-annex.t
+++ b/t/21_annex-to-annex.t
@@ -56,7 +56,10 @@ with_temp_annexes {
with_temp_annexes {
my (undef, $source1, $source2, $dest) = @_;
- run_bin qw(annex-to-annex --commit source1/foo source2/other dest);
+ # also implicitly test, here, that we can invoke the program by
+ # passing a subroutine reference when invoking main as a class
+ # method
+ App::annex_to_annex->main([qw(--commit source1/foo source2/other dest)]);
@output = $source1->RUN(qw(log -1 --oneline --name-status));
like $output[0], qr/migrated by annex-to-annex/,