33 lines
873 B
Rust
33 lines
873 B
Rust
use std::io;
|
|
use std::io::Read;
|
|
|
|
use oo::*;
|
|
|
|
#[test]
|
|
fn read_samples_text() -> io::Result<()> {
|
|
let mut fh = std::fs::File::open("../../../tests/samples.pr")?;
|
|
let mut contents = String::new();
|
|
fh.read_to_string(&mut contents)?;
|
|
println!("{:#?}", annotated_iovalue_from_str(&contents)?);
|
|
Ok(())
|
|
}
|
|
|
|
#[test]
|
|
fn read_samples_bin() -> io::Result<()> {
|
|
let mut fh = std::fs::File::open("../../../tests/samples.bin")?;
|
|
let mut contents = Vec::new();
|
|
fh.read_to_end(&mut contents)?;
|
|
println!("{:#?}", annotated_iovalue_from_bytes(&contents)?);
|
|
Ok(())
|
|
}
|
|
|
|
#[test]
|
|
fn read_samples_view() -> io::Result<()> {
|
|
let mut fh = std::fs::File::open("../../../tests/samples.bin")?;
|
|
let mut contents = Vec::new();
|
|
fh.read_to_end(&mut contents)?;
|
|
let v = packed::view::View::new(contents)?;
|
|
println!("{:#?}", value(&v));
|
|
Ok(())
|
|
}
|