forked from 1b-agent/opencadstudio-upstream
Merge pull request #1340 from CiberNin/fix/editor-crashes
Fix editor crashes from typed input, text, and degenerate geometry
This commit is contained in:
commit
3c1ad62e9b
12 files changed
+391
-27
No files matched your search
@@ -2460,3 +2460,22 @@ mod region_tests {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod degenerate_constraint_tests {
|
||||
use crate::app::OpenCADStudio;
|
||||
|
||||
/// Retaining a zero-length line's size used to hand the solver a NaN
|
||||
/// Jacobian, and its SVD fallback never returned.
|
||||
#[test]
|
||||
fn equal_constraint_with_a_zero_length_line_returns() {
|
||||
let mut app = OpenCADStudio::new_for_test();
|
||||
app.automation_op(r#"{"op":"new"}"#);
|
||||
app.automation_op(r#"{"op":"run","cmd":"LINE 0,0 0,0 "}"#);
|
||||
app.automation_op(r#"{"op":"run","cmd":"LINE 5,5 20,7 "}"#);
|
||||
app.automation_op(r#"{"op":"select","type":"Line"}"#);
|
||||
app.automation_op(r#"{"op":"run","cmd":"ECONSTRAINT"}"#);
|
||||
let lines = app.automation_op(r#"{"op":"query","type":"Line","detail":"geometry"}"#);
|
||||
assert_eq!(lines["ok"], true, "{lines}");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user