Add test for type ascription in let expressions
This commit is contained in:
parent
24d46d5db4
commit
cf403b3f6e
1 changed files with 10 additions and 0 deletions
|
@ -156,3 +156,13 @@ fn let_lexical_scope() {
|
||||||
"Twilight thought I had 99 cupcakes, ",
|
"Twilight thought I had 99 cupcakes, ",
|
||||||
"but I only had 42."));
|
"but I only had 42."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn let_type_ascription() {
|
||||||
|
let s = html! {
|
||||||
|
@let x: u32 = 42 {
|
||||||
|
"I have " (x) " cupcakes!"
|
||||||
|
}
|
||||||
|
}.into_string();
|
||||||
|
assert_eq!(s, "I have 42 cupcakes!");
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue