1mod job;
8mod lua_exports;
9
10#[mlua::lua_module]
12fn cargo_nvim(lua: &mlua::Lua) -> mlua::Result<mlua::Table> {
13 lua_exports::register_commands(lua)
14}
15
16#[cfg(test)]
17mod tests {
18 use super::*;
19 use mlua::Lua;
20
21 #[test]
22 fn test_module_registration() {
23 let lua = Lua::new();
24 assert!(cargo_nvim(&lua).is_ok());
25 }
26
27 #[test]
28 fn test_exported_functions() {
29 let lua = Lua::new();
30 let table = cargo_nvim(&lua).unwrap();
31 assert!(table.get::<mlua::Function>("start").is_ok());
32 assert!(table.get::<mlua::Function>("poll").is_ok());
33 assert!(table.get::<mlua::Function>("send_input").is_ok());
34 assert!(table.get::<mlua::Function>("interrupt").is_ok());
35 }
36}