MCPcopy Create free account
hub / github.com/PRQL/prql / test_module_shadow_unshadow

Function test_module_shadow_unshadow

prqlc/prqlc/src/semantic/module.rs:514–528  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

512
513 #[test]
514 fn test_module_shadow_unshadow() {
515 let mut module = Module::default();
516
517 let ident = Ident::from_name("test_name");
518 let expr: Expr = Expr::new(ExprKind::Literal(Literal::Integer(42)));
519 let decl: Decl = DeclKind::Expr(Box::new(expr)).into();
520
521 module.insert(ident.clone(), decl.clone()).unwrap();
522
523 module.shadow("test_name");
524 assert!(module.get(&ident) != Some(&decl));
525
526 module.unshadow("test_name");
527 assert_eq!(module.get(&ident).unwrap(), &decl);
528 }
529}

Callers

nothing calls this directly

Calls 5

LiteralEnum · 0.85
shadowMethod · 0.80
unshadowMethod · 0.80
ExprClass · 0.50
insertMethod · 0.45

Tested by

no test coverage detected