add export test so we dont break cli / kcl.py (#5553)

* add export test so we dont break cli / kcl.py

Signed-off-by: Jess Frazelle <github@jessfraz.com>

Overwrite created date (#5602)

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2025-03-03 10:26:01 -08:00
committed by GitHub
parent 191dcf8bb0
commit dfcea282ec
4 changed files with 182 additions and 1 deletions

View File

@ -1,7 +1,7 @@
mod cache;
use kcl_lib::{
test_server::{execute_and_snapshot, execute_and_snapshot_no_auth},
test_server::{execute_and_export_step, execute_and_snapshot, execute_and_snapshot_no_auth},
ExecError, UnitLength,
};
@ -2081,3 +2081,17 @@ async fn kcl_test_ensure_nothing_left_in_batch_multi_file() {
assert!(ctx.engine.batch().read().await.is_empty());
assert!(ctx.engine.batch_end().read().await.is_empty());
}
#[tokio::test(flavor = "multi_thread")]
async fn kcl_test_exporting_step_file() {
// This tests export like how we do it in cli and kcl.py.
let code = kcl_input!("helix_defaults_negative_extrude");
let (_, _, files) = execute_and_export_step(code, UnitLength::Mm, None).await.unwrap();
for file in files {
expectorate::assert_contents(
format!("e2e/executor/outputs/helix_defaults_negative_extrude_{}", file.name),
std::str::from_utf8(&file.contents).unwrap(),
);
}
}