fix source range for last command when engine error (#2757)

* fix source range for last command

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* add known issues

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* add a comment

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2024-06-22 16:22:32 -07:00
committed by GitHub
parent fa37752a41
commit 3300772e3d
5 changed files with 47 additions and 3 deletions

View File

@ -2245,3 +2245,27 @@ const baseExtrusion = extrude(width, sketch001)
1.0,
);
}
#[tokio::test(flavor = "multi_thread")]
async fn serial_test_engine_error_source_range_on_last_command() {
let code = r#"const sketch001 = startSketchOn('XZ')
|> startProfileAt([61.74, 206.13], %)
|> xLine(305.11, %, 'seg01')
|> yLine(-291.85, %)
|> xLine(-segLen('seg01', %), %)
|> lineTo([profileStartX(%), profileStartY(%)], %)
|> close(%)
|> extrude(40.14, %)
|> shell({
faces: ["seg01"],
thickness: 3.14,
}, %)
"#;
let result = execute_and_snapshot(code, UnitLength::Mm).await;
assert!(result.is_err());
assert_eq!(
result.err().unwrap().to_string(),
r#"engine: KclErrorDetails { source_ranges: [SourceRange([262, 320])], message: "Modeling command failed: [ApiError { error_code: InternalEngine, message: \"Invalid brep after shell operation\" }]" }"#
);
}