()
| 734 | |
| 735 | #[test] |
| 736 | fn test_define_and_get_user_callable() -> Result<()> { |
| 737 | let upcalls = HashMap::default(); |
| 738 | let mut global = GlobalSymtable::new(upcalls); |
| 739 | |
| 740 | let md = CallableMetadataBuilder::new("MY_FUNC") |
| 741 | .with_return_type(ExprType::Integer) |
| 742 | .test_build(); |
| 743 | global.declare_user_callable(&VarRef::new("my_func", None), md)?; |
| 744 | |
| 745 | let found = global.get_callable(&SymbolKey::from("my_func")); |
| 746 | assert!(found.is_some()); |
| 747 | assert_eq!("MY_FUNC", found.unwrap().name()); |
| 748 | |
| 749 | Ok(()) |
| 750 | } |
| 751 | |
| 752 | #[test] |
| 753 | fn test_define_user_callable_already_defined_but_is_compatible() -> Result<()> { |
nothing calls this directly
no test coverage detected