mirror of
https://git.proxmox.com/git/perlmod
synced 2025-10-04 22:07:05 +00:00
update test files
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
fbf0c7a20b
commit
fa780264ca
@ -10,3 +10,4 @@ crate-type = [ "cdylib" ]
|
||||
[dependencies]
|
||||
anyhow = "1.0"
|
||||
perlmod = { path = "../perlmod", features = [ "exporter" ] }
|
||||
serde = { version = "1.0", features = [ "derive" ] }
|
||||
|
@ -1,3 +1,8 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub struct Blubber(String);
|
||||
|
||||
#[perlmod::package(name = "RSPM::Foo142", lib = "perlmod_test")]
|
||||
mod export {
|
||||
use anyhow::{bail, Error};
|
||||
@ -22,4 +27,10 @@ mod export {
|
||||
println!("teststr called with {:?}", t);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[export]
|
||||
fn test_serde(value: super::Blubber) -> Result<(), Error> {
|
||||
println!("got {:?}", value);
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
2
test.pl
2
test.pl
@ -24,3 +24,5 @@ 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");
|
||||
|
@ -4,6 +4,7 @@ test called with Some("lo ")
|
||||
teststr called with Some("lo ")
|
||||
test called with None
|
||||
teststr called with None
|
||||
got Blubber("Hello")
|
||||
Got (17, 32, )
|
||||
Got: 2 values: 17 32
|
||||
These should be called with a valid substr:
|
||||
|
Loading…
Reference in New Issue
Block a user