()
| 1044 | |
| 1045 | #[test] |
| 1046 | fn test_global_put_and_get_array() -> Result<()> { |
| 1047 | let upcalls = HashMap::default(); |
| 1048 | let mut global = GlobalSymtable::new(upcalls); |
| 1049 | |
| 1050 | let reg = global.put_global( |
| 1051 | SymbolKey::from("arr"), |
| 1052 | SymbolPrototype::Array(ArrayInfo { subtype: ExprType::Integer, ndims: 2 }), |
| 1053 | )?; |
| 1054 | assert_eq!(Register::global(0).unwrap(), reg); |
| 1055 | |
| 1056 | let (got_reg, proto) = global.get_global(&VarRef::new("arr", None)).unwrap(); |
| 1057 | assert_eq!(Register::global(0).unwrap(), got_reg); |
| 1058 | let SymbolPrototype::Array(info) = proto else { panic!("Expected Array prototype") }; |
| 1059 | assert_eq!(ExprType::Integer, info.subtype); |
| 1060 | assert_eq!(2, info.ndims); |
| 1061 | |
| 1062 | Ok(()) |
| 1063 | } |
| 1064 | |
| 1065 | #[test] |
| 1066 | fn test_local_put_and_get_array() -> Result<()> { |
nothing calls this directly
no test coverage detected