test launcher run & info
@@ -137,3 +137,38 @@ impl Launcher {
}
}
+
+
+#[cfg(test)]
+mod test_launcher {
+
+ use super::*;
+
+ #[test]
+ fn run() {
+ let mut data = DataHolder::new();
+ data.filetype = String::from("rust");
+ data.current_line = String::from("println!(\"Hello\");");
+ data.current_bloc = String::from("println!(\"Hello\");");
+ data.range = [1,1];
+
+ let launcher = Launcher::new(data);
+ let res = launcher.select_and_run();
+ assert_eq!(res.unwrap(), "Hello\n");
+ }
+
+ #[test]
+ fn info() {
+ let mut data = DataHolder::new();
+ data.filetype = String::from("rust");
+ data.current_line = String::from("println!(\"Hello\");");
+ data.current_bloc = String::from("println!(\"Hello\");");
+ data.range = [1,1];
+
+ let launcher = Launcher::new(data);
+ let _res = launcher.info();
+ }
+
+
+}
+
