2023-10-06 12:17:37 +00:00
|
|
|
use std::fs::read_to_string;
|
|
|
|
|
2023-10-19 02:05:16 +00:00
|
|
|
use dust_lang::*;
|
|
|
|
|
|
|
|
#[test]
|
2023-11-10 21:24:19 +00:00
|
|
|
fn r#async() {
|
|
|
|
let file_contents = read_to_string("examples/async.ds").unwrap();
|
2023-10-19 02:05:16 +00:00
|
|
|
|
2023-12-29 19:01:54 +00:00
|
|
|
interpret(&file_contents).unwrap();
|
2023-10-19 02:05:16 +00:00
|
|
|
}
|
2023-10-06 12:17:37 +00:00
|
|
|
|
2023-11-04 10:02:27 +00:00
|
|
|
#[test]
|
|
|
|
#[ignore]
|
2023-11-10 21:24:19 +00:00
|
|
|
fn async_download() {
|
|
|
|
let file_contents = read_to_string("examples/async_download.ds").unwrap();
|
|
|
|
|
2023-12-29 19:01:54 +00:00
|
|
|
interpret(&file_contents).unwrap();
|
2023-11-10 21:24:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn clue_solver() {
|
|
|
|
let file_contents = read_to_string("examples/clue_solver.ds").unwrap();
|
2023-11-04 10:02:27 +00:00
|
|
|
|
2023-12-29 19:01:54 +00:00
|
|
|
interpret(&file_contents).unwrap();
|
2023-11-04 10:02:27 +00:00
|
|
|
}
|
|
|
|
|
2023-10-06 12:17:37 +00:00
|
|
|
#[test]
|
2023-10-25 20:41:51 +00:00
|
|
|
#[ignore]
|
2023-10-19 02:05:16 +00:00
|
|
|
fn fetch() {
|
|
|
|
let file_contents = read_to_string("examples/fetch.ds").unwrap();
|
2023-10-06 12:17:37 +00:00
|
|
|
|
2023-12-29 19:01:54 +00:00
|
|
|
interpret(&file_contents).unwrap();
|
2023-10-06 12:17:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
2023-10-19 02:05:16 +00:00
|
|
|
fn fibonacci() {
|
|
|
|
let file_contents = read_to_string("examples/fibonacci.ds").unwrap();
|
|
|
|
|
2023-12-29 19:01:54 +00:00
|
|
|
interpret(&file_contents).unwrap();
|
2023-10-19 02:05:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
2023-10-19 02:27:57 +00:00
|
|
|
fn fizzbuzz() {
|
|
|
|
let file_contents = read_to_string("examples/fizzbuzz.ds").unwrap();
|
2023-10-19 02:05:16 +00:00
|
|
|
|
2023-12-29 19:01:54 +00:00
|
|
|
interpret(&file_contents).unwrap();
|
2023-10-19 02:05:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn for_loop() {
|
|
|
|
let file_contents = read_to_string("examples/for_loop.ds").unwrap();
|
|
|
|
|
2023-12-29 19:01:54 +00:00
|
|
|
interpret(&file_contents).unwrap();
|
2023-10-19 02:05:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn hello_world() {
|
|
|
|
let file_contents = read_to_string("examples/hello_world.ds").unwrap();
|
|
|
|
|
2023-12-29 19:01:54 +00:00
|
|
|
interpret(&file_contents).unwrap();
|
2023-10-19 02:05:16 +00:00
|
|
|
}
|
|
|
|
|
2023-11-10 21:24:19 +00:00
|
|
|
#[test]
|
|
|
|
fn jq_data() {
|
|
|
|
let file_contents = read_to_string("examples/jq_data.ds").unwrap();
|
|
|
|
|
2023-12-29 19:01:54 +00:00
|
|
|
interpret(&file_contents).unwrap();
|
2023-11-10 21:24:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn list() {
|
|
|
|
let file_contents = read_to_string("examples/list.ds").unwrap();
|
|
|
|
|
2023-12-29 19:01:54 +00:00
|
|
|
interpret(&file_contents).unwrap();
|
2023-11-10 21:24:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn map() {
|
|
|
|
let file_contents = read_to_string("examples/map.ds").unwrap();
|
|
|
|
|
2023-12-29 19:01:54 +00:00
|
|
|
interpret(&file_contents).unwrap();
|
2023-11-10 21:24:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn random() {
|
|
|
|
let file_contents = read_to_string("examples/random.ds").unwrap();
|
|
|
|
|
2023-12-29 19:01:54 +00:00
|
|
|
interpret(&file_contents).unwrap();
|
2023-11-10 21:24:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn sea_creatures() {
|
|
|
|
let file_contents = read_to_string("examples/sea_creatures.ds").unwrap();
|
|
|
|
|
2023-12-29 19:01:54 +00:00
|
|
|
interpret(&file_contents).unwrap();
|
2023-11-10 21:24:19 +00:00
|
|
|
}
|
|
|
|
|
2023-10-19 02:05:16 +00:00
|
|
|
#[test]
|
|
|
|
fn variables() {
|
|
|
|
let file_contents = read_to_string("examples/variables.ds").unwrap();
|
|
|
|
|
2023-12-29 19:01:54 +00:00
|
|
|
interpret(&file_contents).unwrap();
|
2023-10-19 02:05:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn while_loop() {
|
|
|
|
let file_contents = read_to_string("examples/while_loop.ds").unwrap();
|
2023-10-06 12:17:37 +00:00
|
|
|
|
2023-12-29 19:01:54 +00:00
|
|
|
interpret(&file_contents).unwrap();
|
2023-10-06 12:17:37 +00:00
|
|
|
}
|
2023-11-10 21:24:19 +00:00
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn r#yield() {
|
|
|
|
let file_contents = read_to_string("examples/yield.ds").unwrap();
|
|
|
|
|
2023-12-29 19:01:54 +00:00
|
|
|
interpret(&file_contents).unwrap();
|
2023-11-10 21:24:19 +00:00
|
|
|
}
|