mirror of
https://github.com/Noratrieb/dilaria.git
synced 2026-01-14 17:35:03 +01:00
Add test for return value.
This commit is contained in:
parent
3ac2746658
commit
eaa2f3527c
4 changed files with 24 additions and 0 deletions
|
|
@ -17,6 +17,7 @@ pub fn _run_test(code: &str) -> String {
|
|||
debug: false,
|
||||
step: false,
|
||||
stdout: &mut stdout,
|
||||
parse_only: false,
|
||||
};
|
||||
|
||||
dilaria::run_program(code, &mut cfg);
|
||||
|
|
|
|||
|
|
@ -54,6 +54,18 @@ fancy_print("correct");
|
|||
"#
|
||||
);
|
||||
|
||||
run_test!(
|
||||
return_value,
|
||||
r#"
|
||||
fn get_value() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
let x = get_value();
|
||||
print x;
|
||||
"#
|
||||
);
|
||||
|
||||
run_test!(
|
||||
#[ignore]
|
||||
parameters_and_return,
|
||||
|
|
|
|||
5
tests/snapshots/functions__return_value.snap
Normal file
5
tests/snapshots/functions__return_value.snap
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
source: tests/functions.rs
|
||||
expression: output
|
||||
---
|
||||
"1\n"
|
||||
Loading…
Add table
Add a link
Reference in a new issue