()
| 2073 | |
| 2074 | #[test] |
| 2075 | fn test_index_missing_map_key() { |
| 2076 | let mut ctx = Context::default(); |
| 2077 | let mut map = HashMap::new(); |
| 2078 | map.insert("a".to_string(), Value::Int(1)); |
| 2079 | ctx.add_variable_from_value("mymap", map); |
| 2080 | |
| 2081 | let p = Program::compile(r#"mymap["missing"]"#).expect("Must compile"); |
| 2082 | let result = p.execute(&ctx); |
| 2083 | |
| 2084 | assert!(result.is_err(), "Should error on missing map key"); |
| 2085 | } |
| 2086 | |
| 2087 | mod opaque { |
| 2088 | use crate::objects::{Map, Opaque, OpaqueVal, OptionalValue}; |
nothing calls this directly
no test coverage detected