()
| 1101 | |
| 1102 | #[tokio::test] |
| 1103 | async fn test_clear_resets_runtime_state() { |
| 1104 | let compiler = Compiler::new(&HashMap::default(), &[]).unwrap(); |
| 1105 | let image = compiler.compile(&mut b"x = 7".as_slice()).unwrap(); |
| 1106 | let mut vm = Vm::new(HashMap::default()); |
| 1107 | run_to_end(&mut vm, &image).await; |
| 1108 | |
| 1109 | assert_eq!( |
| 1110 | Some(ConstantDatum::Integer(7)), |
| 1111 | vm.get_program(&image, &SymbolKey::from("x")).unwrap() |
| 1112 | ); |
| 1113 | |
| 1114 | vm.clear(); |
| 1115 | |
| 1116 | assert_eq!( |
| 1117 | Some(ConstantDatum::Integer(0)), |
| 1118 | vm.get_program(&image, &SymbolKey::from("x")).unwrap() |
| 1119 | ); |
| 1120 | } |
| 1121 | |
| 1122 | #[tokio::test] |
| 1123 | async fn test_clear_preserves_upcall_caches() { |
nothing calls this directly
no test coverage detected