mirror of
https://git.pumpin.online/funkpower/catena.git
synced 2026-10-23 03:07:13 +00:00
pdftriage: text layer verdicts, including the reflected-font recovery
This commit is contained in:
@@ -328,6 +328,17 @@ mod tests {
|
||||
assert_eq!(back[0].text, "two\nlines");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_float_survives_the_round_trip_bit_for_bit() {
|
||||
for score in [0.1, 0.9740932642487047, 1.0 / 3.0, f64::MIN_POSITIVE, 1e308] {
|
||||
let hit = Hit::new("a", Channel::Vector, 1, score);
|
||||
let mut out = Vec::new();
|
||||
write_line(&mut out, &hit).unwrap();
|
||||
let back: Vec<Hit> = read(out.as_slice()).collect::<Result<_, _>>().unwrap();
|
||||
assert_eq!(back[0].score.to_bits(), score.to_bits(), "{score}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn what_is_written_reads_back_identical() {
|
||||
let hit = Hit::new("a", Channel::Vector, 3, 0.125);
|
||||
|
||||
Reference in New Issue
Block a user