test updates

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2021-07-02 11:32:30 +02:00
parent 3f7917309b
commit 83ac604e08
3 changed files with 27 additions and 4 deletions

View File

@ -29,8 +29,8 @@ mod export {
}
#[export]
fn test_serde(value: super::Blubber) -> Result<(), Error> {
fn test_serde(value: super::Blubber) -> Result<String, Error> {
println!("got {:?}", value);
Ok(())
Ok(value.0)
}
}

16
test.pl
View File

@ -25,4 +25,18 @@ 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");
my $a = "Can I have some coffee please?\n";
print $a;
my $b = RSPM::Foo142::test_serde($a);
print $b;
my $c = RSPM::Foo142::test_serde($b);
print $c;
use utf8;
binmode STDOUT, ':utf8';
my $a = "Can I have some ☕ please?\n";
print $a;
my $b = RSPM::Foo142::test_serde($a);
print $b;
my $c = RSPM::Foo142::test_serde($b);
print $c;

View File

@ -4,9 +4,18 @@ test called with Some("lo ")
teststr called with Some("lo ")
test called with None
teststr called with None
got Blubber("Hello")
got Blubber("Can I have some coffee please?\n")
got Blubber("Can I have some coffee please?\n")
got Blubber("Can I have some ☕ please?\n")
got Blubber("Can I have some ☕ please?\n")
Got (17, 32, )
Got: 2 values: 17 32
These should be called with a valid substr:
Parameter exists: NO
Was auto-vivified: NO
Can I have some coffee please?
Can I have some coffee please?
Can I have some coffee please?
Can I have some ☕ please?
Can I have some ☕ please?
Can I have some ☕ please?