Test with a circle function (#1030)

This commit is contained in:
Adam Chalmers
2023-11-08 15:06:41 -06:00
committed by GitHub
parent 371d8e08f7
commit d337ac2546
5 changed files with 4487 additions and 0 deletions

View File

@ -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"));
} }

View 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)

View File

@ -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");

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB