rust/mapgen/src/lib.rs
branchtransitional_engine
changeset 15954 9502611bffc1
parent 15953 d46ad15c6dec
child 15955 b0e8cc72bfef
--- a/rust/mapgen/src/lib.rs	Mon Feb 13 17:02:08 2023 +0100
+++ b/rust/mapgen/src/lib.rs	Tue Feb 14 08:52:20 2023 +0100
@@ -17,7 +17,6 @@
 };
 use rand::{seq::SliceRandom, Rng};
 
-
 use std::{borrow::Borrow, collections::hash_map::HashMap};
 use vec2d::Vec2D;
 
@@ -249,7 +248,8 @@
 
 #[cfg(test)]
 mod tests {
-    use crate::{MapGenerator, TemplateType};
+    use crate::{MapGenerator, TemplateType, OutlineTemplate};
+    use rand::thread_rng;
 
     #[test]
     fn simple_load() {
@@ -283,14 +283,14 @@
     test: [0]
 "#;
 
-        let mut generator = MapGenerator::new();
+        let mut generator = MapGenerator::<OutlineTemplate>::new();
         generator.import_yaml_templates(&text);
 
         assert!(generator
             .templates
             .contains_key(&TemplateType("test".to_string())));
 
-        let template = generator.get_template("test").unwrap();
+        let template = generator.get_template("test", &mut thread_rng()).unwrap();
 
         assert_eq!(template.islands[0].len(), 7);
     }