Add test for match example

This commit is contained in:
Jeff 2023-12-31 18:14:00 -05:00
parent 32127a6cda
commit 128ddc385c
2 changed files with 9 additions and 2 deletions

View File

@ -1,9 +1,9 @@
foo_or_bar = match (random_boolean) {
foo_or_bar = match random_boolean() {
true => "foo"
false => "bar"
}
num = match (random_integer) {
num = match random_integer() {
1 => "one",
2 => { "two" },
* => "neither",

View File

@ -81,6 +81,13 @@ fn map() {
interpret(&file_contents).unwrap();
}
#[test]
fn r#match() {
let file_contents = read_to_string("examples/match.ds").unwrap();
interpret(&file_contents).unwrap();
}
#[test]
fn random() {
let file_contents = read_to_string("examples/random.ds").unwrap();