perlmod/test.pl
Wolfgang Bumiller fa780264ca update test files
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-06-23 10:58:31 +02:00

29 lines
722 B
Perl

#!/usr/bin/env perl
use v5.28.0;
use lib '.';
use RSPM::Bless;
use RSPM::Foo142;
my $v = RSPM::Bless->new("Hello");
$v->something();
my ($a, $b, $c) = $v->multi_return();
say "Got ($a, $b, $c)";
my @ret = $v->multi_return();
say "Got: ".scalar(@ret)." values: @ret";
$v->another(54);
my $param = { a => 1 };
my $s = "Hello You";
print "These should be called with a valid substr:\n";
RSPM::Foo142::test(substr($s, 3, 3));
RSPM::Foo142::teststr(substr($s, 3, 3));
print "Parameter exists: " . (exists($param->{x}) ? "YES" : "NO") . "\n";
RSPM::Foo142::test($param->{x});
print "Was auto-vivified: " . (exists($param->{x}) ? "YES" : "NO") . "\n";
RSPM::Foo142::teststr($param->{x});
RSPM::Foo142::test_serde("Hello");