diff --git a/examples/jq_data.ds b/examples/jq_data.ds index 3673a51..62e7092 100644 --- a/examples/jq_data.ds +++ b/examples/jq_data.ds @@ -1,4 +1,4 @@ -data = json:parse(fs:read('examples/assets/jq_data.json')) +data = json:parse(fs:read_file('examples/assets/jq_data.json')) new_data = [] diff --git a/examples/sea_creatures.ds b/examples/sea_creatures.ds index 79af3b4..2e4d446 100644 --- a/examples/sea_creatures.ds +++ b/examples/sea_creatures.ds @@ -1,4 +1,4 @@ -raw_data = fs:read('examples/assets/seaCreatures.json') +raw_data = fs:read_file('examples/assets/seaCreatures.json') sea_creatures = json:parse(raw_data) data = { diff --git a/tests/dust_examples.rs b/tests/dust_examples.rs index c1b6845..2f80496 100644 --- a/tests/dust_examples.rs +++ b/tests/dust_examples.rs @@ -9,6 +9,13 @@ fn r#async() { interpret(&file_contents).unwrap(); } +#[test] +fn async_commands() { + let file_contents = read_to_string("examples/async_commands.ds").unwrap(); + + interpret(&file_contents).unwrap(); +} + #[test] #[ignore] fn async_download() { @@ -26,8 +33,8 @@ fn clue_solver() { #[test] #[ignore] -fn fetch() { - let file_contents = read_to_string("examples/fetch.ds").unwrap(); +fn download() { + let file_contents = read_to_string("examples/download.ds").unwrap(); interpret(&file_contents).unwrap(); } @@ -46,13 +53,6 @@ fn fizzbuzz() { interpret(&file_contents).unwrap(); } -#[test] -fn for_loop() { - let file_contents = read_to_string("examples/for_loop.ds").unwrap(); - - interpret(&file_contents).unwrap(); -} - #[test] fn hello_world() { let file_contents = read_to_string("examples/hello_world.ds").unwrap(); @@ -66,28 +66,6 @@ fn jq_data() { interpret(&file_contents).unwrap(); } - -#[test] -fn list() { - let file_contents = read_to_string("examples/list.ds").unwrap(); - - interpret(&file_contents).unwrap(); -} - -#[test] -fn map() { - let file_contents = read_to_string("examples/map.ds").unwrap(); - - 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(); @@ -101,24 +79,3 @@ fn sea_creatures() { interpret(&file_contents).unwrap(); } - -#[test] -fn variables() { - let file_contents = read_to_string("examples/variables.ds").unwrap(); - - interpret(&file_contents).unwrap(); -} - -#[test] -fn while_loop() { - let file_contents = read_to_string("examples/while_loop.ds").unwrap(); - - interpret(&file_contents).unwrap(); -} - -#[test] -fn r#yield() { - let file_contents = read_to_string("examples/yield.ds").unwrap(); - - interpret(&file_contents).unwrap(); -}