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

Function test_scope_get_pos_expression_arg

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

Source from the content-addressed store, hash-verified

1236
1237 #[tokio::test]
1238 async fn test_scope_get_pos_expression_arg() {
1239 let positions: Rc<RefCell<Vec<LineCol>>> = Rc::default();
1240 let cmd = PosCapture::new(1, positions.clone());
1241 let mut upcalls_by_name: HashMap<SymbolKey, Rc<dyn Callable>> = HashMap::new();
1242 upcalls_by_name.insert(SymbolKey::from("POS_CAPTURE"), cmd);
1243
1244 let compiler = Compiler::new(&upcalls_by_name, &[]).unwrap();
1245 let image = compiler.compile(&mut b"POS_CAPTURE 1 + 2".as_slice()).unwrap();
1246 let mut vm = Vm::new(upcalls_by_name);
1247 run_to_end(&mut vm, &image).await;
1248
1249 let pos = positions.borrow();
1250 assert_eq!(&[LineCol { line: 1, col: 13 }], pos.as_slice());
1251 }
1252
1253 #[tokio::test]
1254 async fn test_get_program_scalar() {

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