Thing 2.0 cut 6b fix: alt-fits test through a stretched flat entry; more random plots
All checks were successful
Portable Eve contracts and browser lowering / ubuntu-latest eve-browser-lowering (pull_request) Successful in 4m21s
Portable Eve contracts and browser lowering / ubuntu-latest eve-contracts (pull_request) Successful in 3m8s

This commit is contained in:
Meta Vens 2026-11-28 08:35:23 +01:00
commit 9fea58d832

View file

@ -626,7 +626,7 @@ fn random_documents_render_without_panic_balanced_and_equal() {
initial: lit_text(["", "typed words"][(next() % 2) as usize]),
submit: command("dismiss"),
}),
(8, _) => Node::Plot(PlotNode { common: common(&id), series: series_bind("s"), mark: [PlotMark::Line, PlotMark::Area, PlotMark::Bar][(next() % 3) as usize].clone(), x_min: None, x_max: None, y_min: None, y_max: None }),
(8 | 9, _) => Node::Plot(PlotNode { common: common(&id), series: series_bind("s"), mark: [PlotMark::Line, PlotMark::Area, PlotMark::Bar][(next() % 3) as usize].clone(), x_min: None, x_max: None, y_min: None, y_max: None }),
(2, d) if d < 3 => {
let anchor = if next() % 2 == 0 { Anchor::Viewport } else { at(&generated[(next() % generated.len() as u64) as usize]) };
let children = (0..(next() % 3)).map(|_| grow(depth + 1, next, counter, generated, sizes, overflows, tokens)).collect();
@ -662,7 +662,7 @@ fn random_documents_render_without_panic_balanced_and_equal() {
// Image fit and Plot lowering run wherever the document holds them.
let mut state = MemState::new();
state.put(&ProviderId::new(PROVIDER), &catalog(&[("x", 50, 20)]));
let values: Vec<f64> = (0..next() % 9)
let values: Vec<f64> = (0..2 + next() % 8)
.map(|_| match next() % 7 {
0 => f64::NAN,
1 => f64::INFINITY,
@ -1139,9 +1139,9 @@ fn the_alt_line_of_a_placeholder_draws_only_when_it_fits() {
let provider = ProviderId::new(PROVIDER);
let in_grid = |height: f64| {
let mut state = MemState::new();
state.put(&provider, &catalog(&[("empty", 0, 0)]));
let grid = BoxStyle { display: Display::Grid, grid_columns: vec![px(100.0)], grid_rows: vec![px(height)], ..plain() };
let out = with_state(&mut state, flat("root", grid, vec![image("pic", "empty", ImageFit::Contain)]), &pixels(1.0));
// A 100x0 entry is no extent and an invalid measure, so a row stretches it to the row's height.
state.put(&provider, &catalog(&[("flat", 100, 0)]));
let out = with_state(&mut state, flat("root", sized(100.0, height), vec![image("pic", "flat", ImageFit::Contain)]), &pixels(1.0));
assert_eq!(placed(&out, "pic").rect, rect(0.0, 0.0, 100.0, height as f32));
out
};