dust/tests/dust_examples.rs

108 lines
2.1 KiB
Rust
Raw Normal View History

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]
fn clue_solver() {
let file_contents = read_to_string("examples/clue_solver").unwrap();
evaluate(&file_contents).unwrap();
}
2023-10-06 12:17:37 +00:00
#[test]
fn collections() {
let file_contents = read_to_string("examples/collections.ds").unwrap();
2023-10-09 19:54:47 +00:00
evaluate(&file_contents).unwrap();
2023-10-06 12:17:37 +00:00
}
#[test]
2023-10-19 02:05:16 +00:00
fn data_formats() {
let file_contents = read_to_string("examples/data_formats.ds").unwrap();
2023-10-06 12:17:37 +00:00
2023-10-09 19:54:47 +00:00
evaluate(&file_contents).unwrap();
2023-10-06 12:17:37 +00:00
}
#[test]
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-10-09 19:54:47 +00:00
evaluate(&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();
evaluate(&file_contents).unwrap();
}
#[test]
fn find_loop() {
let file_contents = read_to_string("examples/find_loop.ds").unwrap();
evaluate(&file_contents).unwrap();
}
#[test]
fn fizzbuzz() {
let file_contents = read_to_string("examples/fizzbuzz.ds").unwrap();
2023-10-19 02:05:16 +00:00
evaluate(&file_contents).unwrap();
}
#[test]
fn for_loop() {
let file_contents = read_to_string("examples/for_loop.ds").unwrap();
evaluate(&file_contents).unwrap();
}
#[test]
fn hello_world() {
let file_contents = read_to_string("examples/hello_world.ds").unwrap();
evaluate(&file_contents).unwrap();
}
#[test]
fn remove_loop() {
let file_contents = read_to_string("examples/remove_loop.ds").unwrap();
2023-10-06 12:17:37 +00:00
2023-10-09 19:54:47 +00:00
evaluate(&file_contents).unwrap();
2023-10-06 12:17:37 +00:00
}
#[test]
fn scope() {
let file_contents = read_to_string("examples/scope.ds").unwrap();
2023-10-09 19:54:47 +00:00
evaluate(&file_contents).unwrap();
2023-10-06 12:17:37 +00:00
}
2023-10-19 02:05:16 +00:00
#[test]
fn table() {
let file_contents = read_to_string("examples/table.ds").unwrap();
evaluate(&file_contents).unwrap();
}
2023-10-06 12:17:37 +00:00
#[test]
2023-10-19 02:05:16 +00:00
fn transform_loop() {
let file_contents = read_to_string("examples/transform_loop.ds").unwrap();
evaluate(&file_contents).unwrap();
}
#[test]
fn variables() {
let file_contents = read_to_string("examples/variables.ds").unwrap();
evaluate(&file_contents).unwrap();
}
#[test]
fn while_loop() {
let file_contents = read_to_string("examples/while_loop.ds").unwrap();
2023-10-06 12:17:37 +00:00
2023-10-09 19:54:47 +00:00
evaluate(&file_contents).unwrap();
2023-10-06 12:17:37 +00:00
}