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

@ -148,3 +148,21 @@ impl fmt::Debug for Table {
.finish()
}
}
#[cfg(test)]
mod table_tests {
use super::{ElementType, Table, TableDescriptor};
#[test]
fn test_initial_table_size() {
let table = Table::new(TableDescriptor {
element: ElementType::Anyfunc,
minimum: 10,
maximum: Some(20),
})
.unwrap();
assert_eq!(table.size(), 10);
}
}