fix error sourcce range for kcl stdlib (#1641)
fix error Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
@ -1091,7 +1091,7 @@ impl CallExpression {
|
|||||||
function_expression.params.len(),
|
function_expression.params.len(),
|
||||||
fn_args.len(),
|
fn_args.len(),
|
||||||
),
|
),
|
||||||
source_ranges: vec![(function_expression).into()],
|
source_ranges: vec![self.into()],
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1215,3 +1215,24 @@ const part003 = startSketchOn(part002, "end")
|
|||||||
.unwrap();
|
.unwrap();
|
||||||
twenty_twenty::assert_image("tests/executor/outputs/sketch_on_face_of_face.png", &result, 1.0);
|
twenty_twenty::assert_image("tests/executor/outputs/sketch_on_face_of_face.png", &result, 1.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tokio::test(flavor = "multi_thread")]
|
||||||
|
async fn serial_test_stdlib_kcl_error_right_code_path() {
|
||||||
|
let code = r#"const square = startSketchOn('XY')
|
||||||
|
|> startProfileAt([0, 0], %)
|
||||||
|
|> line([0, 10], %)
|
||||||
|
|> line([10, 0], %)
|
||||||
|
|> line([0, -10], %)
|
||||||
|
|> close(%)
|
||||||
|
|> hole(circle([2, 2], .5), %)
|
||||||
|
|> hole(circle('XY', [2, 8], .5), %)
|
||||||
|
|> extrude(2, %)
|
||||||
|
"#;
|
||||||
|
|
||||||
|
let result = execute_and_snapshot(code, kittycad::types::UnitLength::Mm).await;
|
||||||
|
assert!(result.is_err());
|
||||||
|
assert_eq!(
|
||||||
|
result.err().unwrap().to_string(),
|
||||||
|
r#"semantic: KclErrorDetails { source_ranges: [SourceRange([157, 175])], message: "this function expected 3 arguments, got 2" }"#
|
||||||
|
);
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user