MCPcopy Index your code
hub / github.com/endbasic/endbasic / test_user_callable_shadows_upcall

Function test_user_callable_shadows_upcall

core/src/compiler/syms.rs:811–825  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

809
810 #[test]
811 fn test_user_callable_shadows_upcall() {
812 let key = SymbolKey::from("SHARED");
813 let builtin_md =
814 CallableMetadataBuilder::new("SHARED").with_return_type(ExprType::Boolean).test_build();
815 let mut upcalls_map = HashMap::new();
816 upcalls_map.insert(key, builtin_md);
817
818 let mut global = GlobalSymtable::new(upcalls_map);
819 let user_md =
820 CallableMetadataBuilder::new("SHARED").with_return_type(ExprType::Integer).test_build();
821 global.declare_user_callable(&VarRef::new("shared", None), user_md).unwrap();
822
823 let found = global.get_callable(&SymbolKey::from("shared")).unwrap();
824 assert_eq!(Some(ExprType::Integer), found.return_type());
825 }
826
827 #[test]
828 fn test_get_callable_not_found() {

Callers

nothing calls this directly

Calls 5

test_buildMethod · 0.80
with_return_typeMethod · 0.80
declare_user_callableMethod · 0.80
get_callableMethod · 0.80
insertMethod · 0.45

Tested by

no test coverage detected