Compare commits

...

1 Commits

Author SHA1 Message Date
5ade1e603f Unit test which draws 3 cubes 2024-04-09 16:35:27 -05:00
3 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,18 @@
const width = 20
fn cube = (cx, cy) => {
let d = width/2
startSketchAt([cx-d, cy-d])
|> lineTo([cx+d, cy-d], %)
|> lineTo([cx+d, cy+d], %)
|> lineTo([cx-d, cy+d], %)
|> lineTo([cx-d, cy-d], %)
|> close(%)
|> extrude(width, %)
}
let interval = 30
cube(interval,interval)
cube(0,0)
cube(-interval,interval)

View File

@ -110,6 +110,15 @@ const part002 = startSketchOn(part001, "here")
twenty_twenty::assert_image("tests/executor/outputs/sketch_on_face.png", &result, 0.999);
}
#[tokio::test(flavor = "multi_thread")]
async fn serial_test_three_cubes() {
let code = include_str!("inputs/three_cubes.kcl");
let result = execute_and_snapshot(code, kittycad::types::UnitLength::Mm)
.await
.unwrap();
twenty_twenty::assert_image("tests/executor/outputs/three_cubes.png", &result, 0.999);
}
#[tokio::test(flavor = "multi_thread")]
async fn serial_test_riddle_small() {
let code = include_str!("inputs/riddle_small.kcl");

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB