()
| 1181 | |
| 1182 | #[tokio::test] |
| 1183 | async fn test_scope_get_pos_no_args() { |
| 1184 | let positions: Rc<RefCell<Vec<LineCol>>> = Rc::default(); |
| 1185 | let cmd = PosCapture::new(0, positions.clone()); |
| 1186 | let mut upcalls_by_name: HashMap<SymbolKey, Rc<dyn Callable>> = HashMap::new(); |
| 1187 | upcalls_by_name.insert(SymbolKey::from("POS_CAPTURE"), cmd); |
| 1188 | |
| 1189 | let compiler = Compiler::new(&upcalls_by_name, &[]).unwrap(); |
| 1190 | let image = compiler.compile(&mut b"POS_CAPTURE".as_slice()).unwrap(); |
| 1191 | let mut vm = Vm::new(upcalls_by_name); |
| 1192 | run_to_end(&mut vm, &image).await; |
| 1193 | |
| 1194 | let pos = positions.borrow(); |
| 1195 | assert_eq!(&[] as &[LineCol], pos.as_slice()); |
| 1196 | } |
| 1197 | |
| 1198 | #[tokio::test] |
| 1199 | async fn test_scope_get_pos_single_arg() { |
nothing calls this directly
no test coverage detected