summaryrefslogtreecommitdiff
path: root/t/list_public_keys.t
diff options
context:
space:
mode:
Diffstat (limited to 't/list_public_keys.t')
-rw-r--r--t/list_public_keys.t76
1 files changed, 76 insertions, 0 deletions
diff --git a/t/list_public_keys.t b/t/list_public_keys.t
new file mode 100644
index 0000000..622b092
--- /dev/null
+++ b/t/list_public_keys.t
@@ -0,0 +1,76 @@
+#!/usr/bin/perl -w
+#
+# $Id: list_public_keys.t,v 1.7 2001/05/03 06:00:06 ftobin Exp $
+#
+
+use strict;
+use English qw( -no_match_vars );
+use IO::File;
+
+use lib './t';
+use MyTest;
+use MyTestSpecific;
+
+my $outfile;
+
+TEST
+{
+ reset_handles();
+
+ my $pid = $gnupg->list_public_keys( handles => $handles );
+ close $stdin;
+
+ $outfile = 'test/public-keys/1.out';
+ my $out = IO::File->new( "> $outfile" )
+ or die "cannot open $outfile for writing: $ERRNO";
+ $out->print( <$stdout> );
+ close $stdout;
+ $out->close();
+
+ waitpid $pid, 0;
+
+ return $CHILD_ERROR == 0;
+};
+
+
+TEST
+{
+ reset_handles();
+
+ my $pid = $gnupg->list_public_keys( handles => $handles,
+ command_args => '0x93AFC4B1B0288A104996B44253AE596EF950DA9C'
+ );
+ close $stdin;
+
+ $outfile = 'test/public-keys/2.out';
+ my $out = IO::File->new( "> $outfile" )
+ or die "cannot open $outfile for writing: $ERRNO";
+ $out->print( <$stdout> );
+ close $stdout;
+ $out->close();
+
+ waitpid $pid, 0;
+
+ return $CHILD_ERROR == 0;
+};
+
+
+
+TEST
+{
+ reset_handles();
+
+ $handles->stdout( $texts{temp}->fh() );
+ $handles->options( 'stdout' )->{direct} = 1;
+
+ my $pid = $gnupg->list_public_keys( handles => $handles,
+ command_args => '0x93AFC4B1B0288A104996B44253AE596EF950DA9C',
+ );
+
+ waitpid $pid, 0;
+
+ $outfile = $texts{temp}->fn();
+
+ return $CHILD_ERROR == 0;
+};
+