MCPcopy Index your code
hub / github.com/endbasic/endbasic / test_scope_get_pos_no_args

Function test_scope_get_pos_no_args

core/src/vm/mod.rs:1183–1196  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 4

run_to_endFunction · 0.85
insertMethod · 0.45
compileMethod · 0.45
as_sliceMethod · 0.45

Tested by

no test coverage detected