Change so that var definitions can be a module's return value (#6504)

* Change so that var definitions can be a module's return value

* Change car wheel assembly to use the new return mechanism

* Add sim test

* Update output

* Update module docs

* Add safety check to only work with modules

* Fix to use updated keyword args
This commit is contained in:
Jonathan Tran
2025-04-25 17:55:54 -04:00
committed by GitHub
parent 717a2039cb
commit f8e53d941d
18 changed files with 669 additions and 20 deletions

View File

@ -2240,6 +2240,28 @@ mod multi_transform {
}
}
mod module_return_using_var {
const TEST_NAME: &str = "module_return_using_var";
/// Test parsing KCL.
#[test]
fn parse() {
super::parse(TEST_NAME)
}
/// Test that parsing and unparsing KCL produces the original KCL input.
#[tokio::test(flavor = "multi_thread")]
async fn unparse() {
super::unparse(TEST_NAME).await
}
/// Test that KCL is executed correctly.
#[tokio::test(flavor = "multi_thread")]
async fn kcl_test_execute() {
super::execute(TEST_NAME, true).await
}
}
mod import_transform {
const TEST_NAME: &str = "import_transform";