forked from 1b-agent/opencadstudio-upstream
ci: run the workspace tests on every change; drop the unused flake
- .github/workflows/ci.yml runs `cargo test --workspace --locked` on pushes to main and on pull requests, with the Linux libraries the release build installs. No formatter check: the tree is not rustfmt-clean and stays that way. - flake.nix, flake.lock and the direnv hook are removed. Nothing used them, and their pinned dependency hashes were already stale after the codec and kernel bumps. - Under cfg(test) the "system" language resolves to en-US. The unit tests compare English text through one process-wide loader, and every apply_config of a default config asked for the system language, so a Turkish locale failed 22 tests and parallel tests raced each other through a language switch (the thickness-row test found its section under one language and looked it up under another). - The arc grip test follows #1352: the start, end and midpoint grips drive the whole arc. Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
1 parent
fd2062bdec
commit
ececb0ef8c
7 files changed
+63
-218
No files matched your search
@@ -158,6 +158,13 @@ impl std::fmt::Display for Language {
|
||||
}
|
||||
|
||||
fn system_languages() -> Vec<i18n_embed::unic_langid::LanguageIdentifier> {
|
||||
// The unit tests compare English prompts and messages through one
|
||||
// process-wide loader, and every `apply_config` of a default config asks
|
||||
// for the system language, so the machine's locale must never reach
|
||||
// them — not even from a test that runs in parallel.
|
||||
#[cfg(test)]
|
||||
return vec!["en-US".parse().expect("en-US is a valid language identifier")];
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
let mut requested = WebLanguageRequester::requested_languages();
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
|
||||
@@ -2371,7 +2371,10 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn arc_grips_drive_center_start_and_end_but_not_midpoint() {
|
||||
/// The center grip drives the center; the start, end and midpoint grips
|
||||
/// reshape the arc, so they drive the whole curve and a paired Equal or
|
||||
/// Symmetric follows the new radius and sweep.
|
||||
fn arc_grips_drive_center_or_the_whole_arc() {
|
||||
let handle = h(8);
|
||||
let arc = acadrust::EntityType::Arc(acadrust::entities::Arc::from_coords(
|
||||
0.0,
|
||||
@@ -2386,15 +2389,14 @@ mod tests {
|
||||
grip_solve_anchor_refs(&arc, handle, 0),
|
||||
vec![ParametricRef::center(handle)]
|
||||
);
|
||||
assert_eq!(
|
||||
grip_solve_anchor_refs(&arc, handle, 1),
|
||||
vec![ParametricRef::point(handle, 0)]
|
||||
);
|
||||
assert_eq!(
|
||||
grip_solve_anchor_refs(&arc, handle, 2),
|
||||
vec![ParametricRef::point(handle, 1)]
|
||||
);
|
||||
assert_eq!(grip_solve_anchor_refs(&arc, handle, 3), Vec::new());
|
||||
for grip in 1..=3 {
|
||||
assert_eq!(
|
||||
grip_solve_anchor_refs(&arc, handle, grip),
|
||||
vec![ParametricRef::whole(handle)],
|
||||
"grip {grip}"
|
||||
);
|
||||
}
|
||||
assert_eq!(grip_solve_anchor_refs(&arc, handle, 4), Vec::new());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in new issue
Block a user