Use minimum limit as initial table size (#196)

This commit is contained in:
Brandon Fish
2019-02-22 13:16:15 -06:00
committed by Mackenzie Clark
parent a6d72bdec9
commit c9969f269c
4 changed files with 38 additions and 5 deletions

View File

@ -306,3 +306,21 @@ impl Clone for SharedMemory {
unimplemented!()
}
}
#[cfg(test)]
mod memory_tests {
use super::{Memory, MemoryDescriptor, Pages};
#[test]
fn test_initial_memory_size() {
let unshared_memory = Memory::new(MemoryDescriptor {
minimum: Pages(10),
maximum: Some(Pages(20)),
shared: false,
})
.unwrap();
assert_eq!(unshared_memory.size(), Pages(10));
}
}