Deduplicate executor code (#2494)

There are many places in the executor codebase which evaluate an AST expression and produce a KCL memory item. They could be deduplicated and put into one central location.

Fixes <https://github.com/KittyCAD/modeling-app/issues/1931>.
This commit is contained in:
Adam Chalmers
2024-05-23 14:50:22 -05:00
committed by GitHub
parent 8e9286a747
commit 51868f892b
5 changed files with 134 additions and 152 deletions

View File

@ -128,6 +128,15 @@ async fn serial_test_lego() {
twenty_twenty::assert_image("tests/executor/outputs/lego.png", &result, 0.999);
}
#[tokio::test(flavor = "multi_thread")]
async fn serial_test_pipe_as_arg() {
let code = include_str!("inputs/pipe_as_arg.kcl");
let result = execute_and_snapshot(code, kcl_lib::settings::types::UnitLength::Mm)
.await
.unwrap();
twenty_twenty::assert_image("tests/executor/outputs/pipe_as_arg.png", &result, 0.999);
}
#[tokio::test(flavor = "multi_thread")]
async fn serial_test_pentagon_fillet_sugar() {
let code = include_str!("inputs/pentagon_fillet_sugar.kcl");