use dry4rust::node::PlaceholderKind;
use dry4rust::normalization_context::NormalizationContext;
#[test]
fn placeholder_counts_each_kind_from_zero_independently() {
let mut ctx = NormalizationContext::new();
let var = ctx.placeholder("a", PlaceholderKind::Variable);
let ty = ctx.placeholder("a", PlaceholderKind::Type);
assert_eq!(var, 0);
assert_eq!(ty, 0);
}
#[test]
fn placeholder_for_distinct_identifiers_returns_rising_indices() {
let mut ctx = NormalizationContext::new();
let first = ctx.placeholder("a", PlaceholderKind::Variable);
let second = ctx.placeholder("b", PlaceholderKind::Variable);
assert_eq!(first, 0);
assert_eq!(second, 1);
}
#[test]
fn placeholder_for_the_same_identifier_twice_returns_the_same_index() {
let mut ctx = NormalizationContext::new();
let first = ctx.placeholder("value", PlaceholderKind::Variable);
let again = ctx.placeholder("value", PlaceholderKind::Variable);
assert_eq!(first, again);
}