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

Function test_get_program_array

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

Source from the content-addressed store, hash-verified

1266
1267 #[tokio::test]
1268 async fn test_get_program_array() {
1269 let compiler = Compiler::new(&HashMap::default(), &[]).unwrap();
1270 let image =
1271 compiler.compile(&mut b"DIM arr(2) AS INTEGER: arr(1) = 45".as_slice()).unwrap();
1272 let mut vm = Vm::new(HashMap::default());
1273 run_to_end(&mut vm, &image).await;
1274
1275 assert_eq!(
1276 Some(ConstantDatum::Integer(45)),
1277 vm.get_program_array(&image, &SymbolKey::from("arr"), &[1]).unwrap()
1278 );
1279 }
1280
1281 #[tokio::test]
1282 async fn test_get_program_type_mismatch_errors() {

Callers

nothing calls this directly

Calls 3

run_to_endFunction · 0.85
compileMethod · 0.45
as_sliceMethod · 0.45

Tested by

no test coverage detected