Skip to content

Commit e545323

Browse files
committed
Add a basic first test
1 parent c7411e1 commit e545323

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/module.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,3 +292,26 @@ impl Module {
292292
input.into()
293293
}
294294
}
295+
296+
#[cfg(test)]
297+
mod tests {
298+
use crate::module::Module;
299+
use crate::module::ModuleType;
300+
use crate::Options;
301+
302+
#[test]
303+
fn check_module_fields() {
304+
let options = Options {
305+
comments: false,
306+
prefixes: true,
307+
target_dir: ".".to_string(),
308+
detect_directory: true,
309+
};
310+
let module = Module::new(ModuleType::Assembly, "A testing assembly with /special-characters*", &options);
311+
312+
// We can't test this until we implement a way to compare the enum values
313+
// assert_eq!(module.mod_type, ModuleType::Assembly);
314+
assert_eq!(module.title, "A testing assembly with /special-characters*".to_string());
315+
assert_eq!(module.id, "a-testing-assembly-with-special-characters".to_string());
316+
}
317+
}

0 commit comments

Comments
 (0)