diff --git a/fidget/src/render/mod.rs b/fidget/src/render/mod.rs index 2470a13f..ed24ae6f 100644 --- a/fidget/src/render/mod.rs +++ b/fidget/src/render/mod.rs @@ -25,6 +25,10 @@ mod test { const HI: &str = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../models/hi.vm")); + const QUARTER: &str = include_str!(concat!( + env!("CARGO_MANIFEST_DIR"), + "/../models/quarter.vm" + )); fn render_and_compare(shape: S, expected: &'static str) { let cfg = RenderConfig::<2> { @@ -50,10 +54,9 @@ mod test { } } - #[test] - fn render_hi_vm() { + fn check_hi() { let (ctx, root) = Context::from_text(HI.as_bytes()).unwrap(); - let shape = VmShape::new(&ctx, root).unwrap(); + let shape = S::new(&ctx, root).unwrap(); const EXPECTED: &str = " .................X.............. .................X.............. @@ -89,4 +92,65 @@ mod test { ................................"; render_and_compare(shape, EXPECTED); } + + fn check_quarter() { + let (ctx, root) = Context::from_text(QUARTER.as_bytes()).unwrap(); + let shape = S::new(&ctx, root).unwrap(); + const EXPECTED: &str = " + ................................ + ................................ + ................................ + ................................ + ................................ + ................................ + ................................ + ................................ + ................................ + ................................ + ................................ + ................................ + ................................ + ................................ + ................................ + ................................ + .....XXXXXXXXXXX................ + .....XXXXXXXXXXX................ + ......XXXXXXXXXX................ + ......XXXXXXXXXX................ + ......XXXXXXXXXX................ + .......XXXXXXXXX................ + ........XXXXXXXX................ + .........XXXXXXX................ + ..........XXXXXX................ + ...........XXXXX................ + ..............XX................ + ................................ + ................................ + ................................ + ................................ + ................................"; + render_and_compare(shape, EXPECTED); + } + + #[test] + fn render_hi_vm() { + check_hi::(); + } + + #[cfg(feature = "jit")] + #[test] + fn render_hi_jit() { + check_hi::(); + } + + #[test] + fn render_quarter_vm() { + check_quarter::(); + } + + #[cfg(feature = "jit")] + #[test] + fn render_quarter_jit() { + check_quarter::(); + } }