Skip to content

Commit 10ca49f

Browse files
add test for method with reference arguments
1 parent 1d74fd7 commit 10ca49f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/generics/src/lib.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ impl<'a, 'b> Contract
1515
where
1616
'a: 'b,
1717
{
18-
pub fn empty() {}
18+
pub fn exec(i1: u32, i2: &u32, i3: &'b u32) -> u32 {
19+
i1 + i2 + *i3
20+
}
1921
}
2022

2123
#[cfg(test)]
@@ -30,6 +32,7 @@ mod test {
3032
let contract_id = e.register(Contract, ());
3133
let client = ContractClient::new(&e, &contract_id);
3234

33-
client.empty();
35+
let res = client.exec(&1, &2, &3);
36+
assert_eq!(res, 6);
3437
}
3538
}

0 commit comments

Comments
 (0)