Stabilize joinir tests and env guards

This commit is contained in:
2025-12-27 17:41:30 +09:00
parent 88ead0df9f
commit 0d6229d5a2
28 changed files with 444 additions and 127 deletions

View File

@ -88,27 +88,27 @@ mod tests {
#[test]
fn test_binding_context_basic() {
let mut ctx = BindingContext::new();
assert!(ctx.is_empty());
assert_eq!(ctx.len(), 0);
assert!(ctx.binding_map.is_empty());
assert_eq!(ctx.binding_map.len(), 0);
let bid = BindingId::new(0);
ctx.insert("x".to_string(), bid);
assert_eq!(ctx.lookup("x"), Some(bid));
assert_eq!(ctx.len(), 1);
assert!(!ctx.is_empty());
assert_eq!(ctx.binding_map.len(), 1);
assert!(!ctx.binding_map.is_empty());
ctx.remove("x");
assert_eq!(ctx.lookup("x"), None);
assert!(ctx.is_empty());
assert!(ctx.binding_map.is_empty());
}
#[test]
fn test_binding_context_contains() {
let mut ctx = BindingContext::new();
assert!(!ctx.contains("x"));
assert!(!ctx.binding_map.contains_key("x"));
ctx.insert("x".to_string(), BindingId::new(0));
assert!(ctx.contains("x"));
assert!(ctx.binding_map.contains_key("x"));
}
#[test]
@ -117,9 +117,8 @@ mod tests {
ctx.insert("a".to_string(), BindingId::new(1));
ctx.insert("b".to_string(), BindingId::new(2));
let map = ctx.binding_map();
assert_eq!(map.len(), 2);
assert_eq!(map.get("a"), Some(&BindingId::new(1)));
assert_eq!(map.get("b"), Some(&BindingId::new(2)));
assert_eq!(ctx.binding_map.len(), 2);
assert_eq!(ctx.binding_map.get("a"), Some(&BindingId::new(1)));
assert_eq!(ctx.binding_map.get("b"), Some(&BindingId::new(2)));
}
}