mirror of
https://github.com/xavo95/repak.git
synced 2025-01-18 10:54:38 +00:00
update tests
This commit is contained in:
parent
384734b959
commit
9716e378ad
1 changed files with 10 additions and 4 deletions
|
@ -97,7 +97,10 @@ fn test_read(version: repak::Version, _file_name: &str, bytes: &[u8]) {
|
||||||
let len = inner_reader.seek(SeekFrom::End(0)).unwrap();
|
let len = inner_reader.seek(SeekFrom::End(0)).unwrap();
|
||||||
let mut reader = ReadCounter::new_size(inner_reader, len as usize);
|
let mut reader = ReadCounter::new_size(inner_reader, len as usize);
|
||||||
|
|
||||||
let pak = repak::PakReader::new_any_with_key(&mut reader, key).unwrap();
|
let pak = repak::PakBuilder::new()
|
||||||
|
.key(key)
|
||||||
|
.reader(&mut reader)
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
assert_eq!(pak.mount_point(), "../mount/point/root/");
|
assert_eq!(pak.mount_point(), "../mount/point/root/");
|
||||||
assert_eq!(pak.version(), version);
|
assert_eq!(pak.version(), version);
|
||||||
|
@ -160,10 +163,13 @@ fn test_write(_version: repak::Version, _file_name: &str, bytes: &[u8]) {
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let mut reader = std::io::Cursor::new(bytes);
|
let mut reader = std::io::Cursor::new(bytes);
|
||||||
let pak_reader = repak::PakReader::new_any_with_key(&mut reader, key).unwrap();
|
let pak_reader = repak::PakBuilder::new()
|
||||||
|
.key(key)
|
||||||
|
.reader(&mut reader)
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
let writer = Cursor::new(vec![]);
|
let writer = Cursor::new(vec![]);
|
||||||
let mut pak_writer = repak::PakWriter::new(
|
let mut pak_writer = repak::PakBuilder::new().writer(
|
||||||
writer,
|
writer,
|
||||||
pak_reader.version(),
|
pak_reader.version(),
|
||||||
pak_reader.mount_point().to_owned(),
|
pak_reader.mount_point().to_owned(),
|
||||||
|
@ -189,7 +195,7 @@ fn test_rewrite_index(_version: repak::Version, _file_name: &str, bytes: &[u8])
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let mut buf = std::io::Cursor::new(bytes.to_vec());
|
let mut buf = std::io::Cursor::new(bytes.to_vec());
|
||||||
let pak_reader = repak::PakReader::new_any_with_key(&mut buf, key).unwrap();
|
let pak_reader = repak::PakBuilder::new().key(key).reader(&mut buf).unwrap();
|
||||||
|
|
||||||
let rewrite = pak_reader
|
let rewrite = pak_reader
|
||||||
.into_pakwriter(buf)
|
.into_pakwriter(buf)
|
||||||
|
|
Loading…
Reference in a new issue