Skip to content

Commit

Permalink
Move tests from no_visuals into simulation tests
Browse files Browse the repository at this point in the history
Now you can properly inspect program memory for the no_visuals tests, instead of relying on a lot of KCL asserts.
  • Loading branch information
adamchalmers committed Nov 1, 2024
1 parent ad1cd56 commit c586ae7
Show file tree
Hide file tree
Showing 39 changed files with 22,680 additions and 182 deletions.
243 changes: 243 additions & 0 deletions src/wasm-lib/kcl/src/simulation_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,3 +189,246 @@ mod double_map_fn {
super::execute(TEST_NAME, false).await
}
}
mod property_of_object {
const TEST_NAME: &str = "property_of_object";

/// Test tokenizing KCL.
#[test]
fn tokenize() {
super::tokenize(TEST_NAME)
}

/// Test parsing KCL.
#[test]
fn parse() {
super::parse(TEST_NAME)
}

/// Test that parsing and unparsing KCL produces the original KCL input.
#[test]
fn unparse() {
super::unparse(TEST_NAME)
}

/// Test that KCL is executed correctly.
#[tokio::test(flavor = "multi_thread")]
async fn kcl_test_execute() {
super::execute(TEST_NAME, false).await
}
}
mod index_of_array {
const TEST_NAME: &str = "index_of_array";

/// Test tokenizing KCL.
#[test]
fn tokenize() {
super::tokenize(TEST_NAME)
}

/// Test parsing KCL.
#[test]
fn parse() {
super::parse(TEST_NAME)
}

/// Test that parsing and unparsing KCL produces the original KCL input.
#[test]
fn unparse() {
super::unparse(TEST_NAME)
}

/// Test that KCL is executed correctly.
#[tokio::test(flavor = "multi_thread")]
async fn kcl_test_execute() {
super::execute(TEST_NAME, false).await
}
}
mod comparisons {
const TEST_NAME: &str = "comparisons";

/// Test tokenizing KCL.
#[test]
fn tokenize() {
super::tokenize(TEST_NAME)
}

/// Test parsing KCL.
#[test]
fn parse() {
super::parse(TEST_NAME)
}

/// Test that parsing and unparsing KCL produces the original KCL input.
#[test]
fn unparse() {
super::unparse(TEST_NAME)
}

/// Test that KCL is executed correctly.
#[tokio::test(flavor = "multi_thread")]
async fn kcl_test_execute() {
super::execute(TEST_NAME, false).await
}
}
mod array_range_expr {
const TEST_NAME: &str = "array_range_expr";

/// Test tokenizing KCL.
#[test]
fn tokenize() {
super::tokenize(TEST_NAME)
}

/// Test parsing KCL.
#[test]
fn parse() {
super::parse(TEST_NAME)
}

/// Test that parsing and unparsing KCL produces the original KCL input.
#[test]
fn unparse() {
super::unparse(TEST_NAME)
}

/// Test that KCL is executed correctly.
#[tokio::test(flavor = "multi_thread")]
async fn kcl_test_execute() {
super::execute(TEST_NAME, false).await
}
}
mod array_range_negative_expr {
const TEST_NAME: &str = "array_range_negative_expr";

/// Test tokenizing KCL.
#[test]
fn tokenize() {
super::tokenize(TEST_NAME)
}

/// Test parsing KCL.
#[test]
fn parse() {
super::parse(TEST_NAME)
}

/// Test that parsing and unparsing KCL produces the original KCL input.
#[test]
fn unparse() {
super::unparse(TEST_NAME)
}

/// Test that KCL is executed correctly.
#[tokio::test(flavor = "multi_thread")]
async fn kcl_test_execute() {
super::execute(TEST_NAME, false).await
}
}
mod sketch_in_object {
const TEST_NAME: &str = "sketch_in_object";

/// Test tokenizing KCL.
#[test]
fn tokenize() {
super::tokenize(TEST_NAME)
}

/// Test parsing KCL.
#[test]
fn parse() {
super::parse(TEST_NAME)
}

/// Test that parsing and unparsing KCL produces the original KCL input.
#[test]
fn unparse() {
super::unparse(TEST_NAME)
}

/// Test that KCL is executed correctly.
#[tokio::test(flavor = "multi_thread")]
async fn kcl_test_execute() {
super::execute(TEST_NAME, false).await
}
}
mod if_else {
const TEST_NAME: &str = "if_else";

/// Test tokenizing KCL.
#[test]
fn tokenize() {
super::tokenize(TEST_NAME)
}

/// Test parsing KCL.
#[test]
fn parse() {
super::parse(TEST_NAME)
}

/// Test that parsing and unparsing KCL produces the original KCL input.
#[test]
fn unparse() {
super::unparse(TEST_NAME)
}

/// Test that KCL is executed correctly.
#[tokio::test(flavor = "multi_thread")]
async fn kcl_test_execute() {
super::execute(TEST_NAME, false).await
}
}
mod add_lots {
const TEST_NAME: &str = "add_lots";

/// Test tokenizing KCL.
#[test]
fn tokenize() {
super::tokenize(TEST_NAME)
}

/// Test parsing KCL.
#[test]
fn parse() {
super::parse(TEST_NAME)
}

/// Test that parsing and unparsing KCL produces the original KCL input.
#[test]
fn unparse() {
super::unparse(TEST_NAME)
}

/// Test that KCL is executed correctly.
#[tokio::test(flavor = "multi_thread")]
async fn kcl_test_execute() {
super::execute(TEST_NAME, false).await
}
}
mod array_elem_push {
const TEST_NAME: &str = "array_elem_push";

/// Test tokenizing KCL.
#[test]
fn tokenize() {
super::tokenize(TEST_NAME)
}

/// Test parsing KCL.
#[test]
fn parse() {
super::parse(TEST_NAME)
}

/// Test that parsing and unparsing KCL produces the original KCL input.
#[test]
fn unparse() {
super::unparse(TEST_NAME)
}

/// Test that KCL is executed correctly.
#[tokio::test(flavor = "multi_thread")]
async fn kcl_test_execute() {
super::execute(TEST_NAME, false).await
}
}
Loading

0 comments on commit c586ae7

Please sign in to comment.