Test with a circle function (#1030)
This commit is contained in:
@ -2813,4 +2813,5 @@ mod snapshot_tests {
|
|||||||
snapshot_test!(aq, "log(5, \"hello\", aIdentifier)");
|
snapshot_test!(aq, "log(5, \"hello\", aIdentifier)");
|
||||||
snapshot_test!(ar, r#"5 + "a""#);
|
snapshot_test!(ar, r#"5 + "a""#);
|
||||||
snapshot_test!(at, "line([0, l], %)");
|
snapshot_test!(at, "line([0, l], %)");
|
||||||
|
snapshot_test!(au, include_str!("../../../tests/executor/inputs/cylinder.kcl"));
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
14
src/wasm-lib/tests/executor/inputs/cylinder.kcl
Normal file
14
src/wasm-lib/tests/executor/inputs/cylinder.kcl
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
fn circle = (plane, center, radius) => {
|
||||||
|
const sg = startSketchOn(plane)
|
||||||
|
|> startProfileAt([center[0] + radius, center[1]], %)
|
||||||
|
|> arc({
|
||||||
|
angle_end: 360,
|
||||||
|
angle_start: 0,
|
||||||
|
radius: radius
|
||||||
|
}, %)
|
||||||
|
|> close(%)
|
||||||
|
return sg
|
||||||
|
}
|
||||||
|
|
||||||
|
const cylinder = circle('XY', [0,0], 22) |> extrude(14, %)
|
||||||
|
show(cylinder)
|
@ -222,6 +222,14 @@ async fn serial_test_execute_pipes_on_pipes() {
|
|||||||
twenty_twenty::assert_image("tests/executor/outputs/pipes_on_pipes.png", &result, 0.999);
|
twenty_twenty::assert_image("tests/executor/outputs/pipes_on_pipes.png", &result, 0.999);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tokio::test(flavor = "multi_thread")]
|
||||||
|
async fn serial_test_execute_cylinder() {
|
||||||
|
let code = include_str!("inputs/cylinder.kcl");
|
||||||
|
|
||||||
|
let result = execute_and_snapshot(code).await.unwrap();
|
||||||
|
twenty_twenty::assert_image("tests/executor/outputs/cylinder.png", &result, 0.999);
|
||||||
|
}
|
||||||
|
|
||||||
#[tokio::test(flavor = "multi_thread")]
|
#[tokio::test(flavor = "multi_thread")]
|
||||||
async fn serial_test_execute_kittycad_svg() {
|
async fn serial_test_execute_kittycad_svg() {
|
||||||
let code = include_str!("inputs/kittycad_svg.kcl");
|
let code = include_str!("inputs/kittycad_svg.kcl");
|
||||||
|
BIN
src/wasm-lib/tests/executor/outputs/cylinder.png
Normal file
BIN
src/wasm-lib/tests/executor/outputs/cylinder.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 98 KiB |
Reference in New Issue
Block a user