mod common;
#[cfg(test)]
mod tests {
use super::*;
use common::RamDisk;
use embedded_io_async::Read;
use polyfs::fs::File;
use polyfs::fs::FileSystem;
use polyfs::fs::fat32::Fat32;
#[tokio::test]
async fn read_file() {
let disk = RamDisk::from_file("tests/disk.img").unwrap();
let mut fs = Fat32::mount(disk).await.unwrap();
let mut file = fs.open("/BLOCK_~1.RS").await.unwrap().file().unwrap();
let mut buf = vec![0u8; file.size() as usize];
file.read_exact(&mut buf).await.unwrap();
let str = String::from_utf8_lossy(&buf);
println!("{}", str);
}
}