Move KCL from Rust strings into files (#3467)

This commit is contained in:
Adam Chalmers
2024-08-15 16:37:42 -05:00
committed by GitHub
parent 8f9bef922f
commit 4fd5e26abe
6 changed files with 49 additions and 71 deletions

View File

@ -182,19 +182,6 @@ async fn kcl_test_negative_args() {
assert_out("negative_args", &result);
}
#[tokio::test(flavor = "multi_thread")]
async fn kcl_test_basic_tangential_arc() {
let code = r#"const boxSketch = startSketchAt([0, 0])
|> line([0, 10], %)
|> tangentialArc({radius: 5, offset: 90}, %)
|> line([5, -15], %)
|> extrude(10, %)
"#;
let result = execute_and_snapshot(code, UnitLength::Mm).await.unwrap();
assert_out("tangential_arc", &result);
}
#[tokio::test(flavor = "multi_thread")]
async fn kcl_test_basic_tangential_arc_with_point() {
let code = r#"const boxSketch = startSketchAt([0, 0])
@ -837,30 +824,6 @@ const part002 = startSketchOn(part001, "end")
assert_out("sketch_on_face_circle", &result);
}
#[tokio::test(flavor = "multi_thread")]
async fn kcl_test_sketch_on_face_circle_tagged() {
let code = r#"fn cube = (pos, scale) => {
const sg = startSketchOn('XY')
|> startProfileAt(pos, %)
|> line([0, scale], %)
|> line([scale, 0], %)
|> line([0, -scale], %)
return sg
}
const part001 = cube([0,0], 20)
|> close(%)
|> extrude(20, %)
const part002 = startSketchOn(part001, "end")
|> circle([0, 0], 5, %, $myCircle)
|> extrude(5, %)
"#;
let result = execute_and_snapshot(code, UnitLength::Mm).await.unwrap();
assert_out("sketch_on_face_circle_tagged", &result);
}
#[tokio::test(flavor = "multi_thread")]
async fn kcl_test_stdlib_kcl_error_circle() {
let code = r#"// Mounting Plate
@ -907,40 +870,6 @@ const part = rectShape([0, 0], 20, 20)
);
}
#[tokio::test(flavor = "multi_thread")]
async fn kcl_test_big_number_angle_to_match_length_x() {
let code = r#"const part001 = startSketchOn('XY')
|> startProfileAt([0, 0], %)
|> line([1, 3.82], %, $seg01)
|> angledLineToX([
-angleToMatchLengthX(seg01, 3, %),
3
], %)
|> close(%)
|> extrude(10, %)
"#;
let result = execute_and_snapshot(code, UnitLength::Mm).await.unwrap();
assert_out("big_number_angle_to_match_length_x", &result);
}
#[tokio::test(flavor = "multi_thread")]
async fn kcl_test_big_number_angle_to_match_length_y() {
let code = r#"const part001 = startSketchOn('XY')
|> startProfileAt([0, 0], %)
|> line([1, 3.82], %, $seg01)
|> angledLineToX([
-angleToMatchLengthY(seg01, 3, %),
3
], %)
|> close(%)
|> extrude(10, %)
"#;
let result = execute_and_snapshot(code, UnitLength::Mm).await.unwrap();
assert_out("big_number_angle_to_match_length_y", &result);
}
#[tokio::test(flavor = "multi_thread")]
async fn kcl_test_simple_revolve() {
let code = r#"const part001 = startSketchOn('XY')