()
| 650 | |
| 651 | #[test] |
| 652 | fn test_local_shadows_global() -> Result<()> { |
| 653 | let upcalls = HashMap::default(); |
| 654 | let mut global = GlobalSymtable::new(upcalls); |
| 655 | global.put_global(SymbolKey::from("x"), SymbolPrototype::Scalar(ExprType::Integer))?; |
| 656 | |
| 657 | let mut local = global.enter_scope(); |
| 658 | local.put_local(SymbolKey::from("x"), SymbolPrototype::Scalar(ExprType::Text))?; |
| 659 | |
| 660 | let (reg, proto) = local.get_local_or_global(&VarRef::new("x", None))?; |
| 661 | assert_eq!(Register::local(0).unwrap(), reg); |
| 662 | assert_eq!(SymbolPrototype::Scalar(ExprType::Text), proto); |
| 663 | |
| 664 | Ok(()) |
| 665 | } |
| 666 | |
| 667 | #[test] |
| 668 | fn test_local_falls_through_to_global() -> Result<()> { |
nothing calls this directly
no test coverage detected