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

Function test_global_get_case_insensitive

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

Source from the content-addressed store, hash-verified

593
594 #[test]
595 fn test_global_get_case_insensitive() -> Result<()> {
596 let upcalls = HashMap::default();
597 let mut global = GlobalSymtable::new(upcalls);
598 global.put_global(SymbolKey::from("MyVar"), SymbolPrototype::Scalar(ExprType::Double))?;
599
600 let (reg, proto) = global.get_global(&VarRef::new("myvar", None))?;
601 assert_eq!(Register::global(0).unwrap(), reg);
602 assert_eq!(SymbolPrototype::Scalar(ExprType::Double), proto);
603
604 let (reg2, _) = global.get_global(&VarRef::new("MYVAR", None))?;
605 assert_eq!(reg, reg2);
606 Ok(())
607 }
608
609 #[test]
610 fn test_global_get_incompatible_type() {

Callers

nothing calls this directly

Calls 2

put_globalMethod · 0.80
get_globalMethod · 0.45

Tested by

no test coverage detected