mod more_or_less;
mod paints;
mod pictures;
mod rendering_tester;
#[cfg(test)]
mod tests;
pub use more_or_less::{
MoreOrLessEquals, PRECISION_ERROR_TOLERANCE, assert_f32_equals, assert_more_or_less_equals,
assert_more_or_less_equals_within,
};
pub use paints::{
CanvasMethod, PaintCall, PaintMismatch, PaintedStyle, RecordedCall, SomethingPredicate,
assert_paints, colors_match, count_calls, draws, paints, paints_exactly,
};
pub use pictures::{painted_ops, painted_ops_deep, pictures, pictures_deep};
pub use rendering_tester::{
EnginePhase, TEST_VIEW_SIZE, install_test_fonts, layout, layout_with, pump_frame,
test_pipeline_owner, test_render_root,
};
pub fn ignoring_hash_codes(text: &str) -> String {
let mut out = String::with_capacity(text.len());
let mut rest = text;
while let Some(at) = rest.find('#') {
out.push_str(&rest[..at]);
let hash = &rest[at + 1..];
let digits = hash.chars().take_while(char::is_ascii_hexdigit).count();
if digits == 5 {
out.push_str("#00000");
rest = &hash[5..];
} else {
out.push('#');
rest = hash;
}
}
out.push_str(rest);
out
}