()
| 980 | |
| 981 | #[test] |
| 982 | fn test_temp_scope_lookup_vars() -> Result<()> { |
| 983 | let upcalls = HashMap::default(); |
| 984 | let mut global = GlobalSymtable::new(upcalls); |
| 985 | global.put_global(SymbolKey::from("g"), SymbolPrototype::Scalar(ExprType::Integer))?; |
| 986 | let mut local = global.enter_scope(); |
| 987 | local.put_local(SymbolKey::from("l"), SymbolPrototype::Scalar(ExprType::Text))?; |
| 988 | |
| 989 | { |
| 990 | let temp = local.frozen(); |
| 991 | |
| 992 | let (reg, proto) = temp.get_local_or_global(&VarRef::new("l", None))?; |
| 993 | assert_eq!(Register::local(0).unwrap(), reg); |
| 994 | assert_eq!(SymbolPrototype::Scalar(ExprType::Text), proto); |
| 995 | |
| 996 | let (reg, proto) = temp.get_local_or_global(&VarRef::new("g", None))?; |
| 997 | assert_eq!(Register::global(0).unwrap(), reg); |
| 998 | assert_eq!(SymbolPrototype::Scalar(ExprType::Integer), proto); |
| 999 | } |
| 1000 | |
| 1001 | Ok(()) |
| 1002 | } |
| 1003 | |
| 1004 | #[test] |
| 1005 | fn test_temp_scope_lookup_callable() -> Result<()> { |
nothing calls this directly
no test coverage detected