MCPcopy Create free account
hub / github.com/cel-rust/cel-rust / test_indexed_map_access

Function test_indexed_map_access

cel/src/objects.rs:1796–1805  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1794
1795 #[test]
1796 fn test_indexed_map_access() {
1797 let mut context = Context::default();
1798 let mut headers = HashMap::new();
1799 headers.insert("Content-Type", "application/json".to_string());
1800 context.add_variable_from_value("headers", headers);
1801
1802 let program = Program::compile("headers[\"Content-Type\"]").unwrap();
1803 let value = program.execute(&context).unwrap();
1804 assert_eq!(value, "application/json".into());
1805 }
1806
1807 #[test]
1808 fn test_numeric_map_access() {

Callers

nothing calls this directly

Calls 2

executeMethod · 0.80

Tested by

no test coverage detected