fuzzing: Add tests for dummy import generation (#2604)

This commit is contained in:
Nick Fitzgerald
2021-01-26 07:11:24 -08:00
committed by GitHub
parent f4faa04dca
commit c7c6e76f9b
2 changed files with 231 additions and 2 deletions

View File

@@ -466,12 +466,12 @@ impl ModuleType {
}
/// Adds a new export to this `ModuleType`.
pub(crate) fn add_named_export(&mut self, name: &str, ty: ExternType) {
pub fn add_named_export(&mut self, name: &str, ty: ExternType) {
self.exports.push((name.to_string(), ty));
}
/// Adds a new import to this `ModuleType`.
pub(crate) fn add_named_import(&mut self, module: &str, field: Option<&str>, ty: ExternType) {
pub fn add_named_import(&mut self, module: &str, field: Option<&str>, ty: ExternType) {
self.imports
.push((module.to_string(), field.map(|f| f.to_string()), ty));
}