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

Function test_temp_scope_first

core/src/compiler/syms.rs:835–847  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

833
834 #[test]
835 fn test_temp_scope_first() -> Result<()> {
836 let upcalls = HashMap::default();
837 let mut global = GlobalSymtable::new(upcalls);
838 let mut local = global.enter_scope();
839 local.put_local(SymbolKey::from("a"), SymbolPrototype::Scalar(ExprType::Integer))?;
840 local.put_local(SymbolKey::from("b"), SymbolPrototype::Scalar(ExprType::Integer))?;
841 {
842 let temp = local.frozen();
843 let mut scope = temp.temp_scope();
844 assert_eq!(Register::local(2).unwrap(), scope.first()?);
845 }
846 Ok(())
847 }
848
849 #[test]
850 fn test_temp_scope_first_no_locals() -> Result<()> {

Callers

nothing calls this directly

Calls 4

enter_scopeMethod · 0.80
put_localMethod · 0.80
frozenMethod · 0.80
temp_scopeMethod · 0.80

Tested by

no test coverage detected