53 lines
1.5 KiB
Rust
53 lines
1.5 KiB
Rust
|
use maraiah::{durandal::{bin, fixed::*}, marathon::{map, trm}};
|
||
|
|
||
|
#[test]
|
||
|
fn read_term_must_process()
|
||
|
{
|
||
|
const INPUT: &[u8] = include_bytes!("data/term.in");
|
||
|
|
||
|
let inp = bin::rd_array(INPUT, trm::read_term).unwrap();
|
||
|
let out = include!("data/term.out");
|
||
|
|
||
|
// for better debug output, we iterate over each item
|
||
|
assert_eq!(inp.len(), out.len());
|
||
|
|
||
|
for (itrm, otrm) in inp.iter().zip(&out) {
|
||
|
assert_eq!(itrm.groups.len(), otrm.groups.len());
|
||
|
for (igrp, ogrp) in itrm.groups.iter().zip(&otrm.groups) {
|
||
|
assert_eq!(igrp, ogrp);
|
||
|
}
|
||
|
|
||
|
assert_eq!(itrm.faces.len(), otrm.faces.len());
|
||
|
for (ifac, ofac) in itrm.faces.iter().zip(&otrm.faces) {
|
||
|
assert_eq!(ifac, ofac);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
#[test]
|
||
|
fn read_minf_must_process()
|
||
|
{
|
||
|
const INPUT: &[u8] = include_bytes!("data/minf.in");
|
||
|
|
||
|
let out = map::Minf{env_code: 0,
|
||
|
physi_id: 1,
|
||
|
music_id: 1,
|
||
|
missi_flags: map::MsnFlags::Repair,
|
||
|
envir_flags: map::EnvFlags::empty(),
|
||
|
entry_flags: map::EntFlags::Solo | map::EntFlags::CoOp,
|
||
|
level_name: "Waterloo Waterpark".to_string()};
|
||
|
|
||
|
assert_eq!(map::read_minf(INPUT).unwrap(), out);
|
||
|
}
|
||
|
|
||
|
#[test]
|
||
|
fn read_epnt_must_process()
|
||
|
{
|
||
|
const INPUT: &[u8] = include_bytes!("data/epnt.in");
|
||
|
const OUTPUT: [map::Point; 54] = include!("data/epnt.out");
|
||
|
|
||
|
assert_eq!(bin::rd_array(INPUT, map::read_epnt).unwrap(), OUTPUT.to_vec());
|
||
|
}
|
||
|
|
||
|
// EOF
|