use std::time::Duration; use swamp_asset_reader::debug::FileAssetReaderDebug; use swamp_asset_reader::file::FileAssetReader; use swamp_asset_reader::AssetReader; #[tokio::test] async fn load_small_png_debug() { let reader = FileAssetReaderDebug::new(Duration::from_millis(100)); let found = reader .fetch_octets("assets/ladder_top.png".into()) .await .expect("png file could not be loaded"); assert_eq!(found.len(), 699); assert_eq!(&found[..5], &[0x89, 0x50, 0x4e, 0x47, 0x0d]); assert_eq!(&found[696..699], &[0x42, 0x60, 0x82]); } #[tokio::test] async fn load_small_png() { let reader = FileAssetReader::new(""); let found = reader .fetch_octets("assets/ladder_top.png".into()) .await .expect("png file could not be loaded"); assert_eq!(found.len(), 699); assert_eq!(&found[..5], &[0x89, 0x50, 0x4e, 0x47, 0x0d]); assert_eq!(&found[696..699], &[0x42, 0x60, 0x82]); }