Add test for match example
This commit is contained in:
parent
32127a6cda
commit
128ddc385c
@ -1,9 +1,9 @@
|
|||||||
foo_or_bar = match (random_boolean) {
|
foo_or_bar = match random_boolean() {
|
||||||
true => "foo"
|
true => "foo"
|
||||||
false => "bar"
|
false => "bar"
|
||||||
}
|
}
|
||||||
|
|
||||||
num = match (random_integer) {
|
num = match random_integer() {
|
||||||
1 => "one",
|
1 => "one",
|
||||||
2 => { "two" },
|
2 => { "two" },
|
||||||
* => "neither",
|
* => "neither",
|
||||||
|
@ -81,6 +81,13 @@ fn map() {
|
|||||||
interpret(&file_contents).unwrap();
|
interpret(&file_contents).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn r#match() {
|
||||||
|
let file_contents = read_to_string("examples/match.ds").unwrap();
|
||||||
|
|
||||||
|
interpret(&file_contents).unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn random() {
|
fn random() {
|
||||||
let file_contents = read_to_string("examples/random.ds").unwrap();
|
let file_contents = read_to_string("examples/random.ds").unwrap();
|
||||||
|
Loading…
Reference in New Issue
Block a user