#[cfg(test)]
mod tests {
#[test]
fn test_local_tag_prefix_5tym() {
let yaml = b"%TAG !m! !my-\n--- # Bulb here\n!m!light fluorescent\n...\n%TAG !m! !my-\n--- # Color here\n!m!light green\n";
let result = crate::test_helpers::parse_yaml(yaml);
assert!(
matches!(result, crate::Node::Documents(_)),
"Should parse TAG directive with local prefix"
);
}
#[test]
fn test_primary_tag_handle_6wlz() {
let yaml = b"# Private\n---\n!foo \"bar\"\n...\n# Global\n%TAG ! tag:example.com,2000:app/\n---\n!foo \"bar\"\n";
let result = crate::test_helpers::parse_yaml(yaml);
#[cfg(feature = "debug-trace")]
println!("6WLZ Result: {:?}", result);
assert!(
matches!(result, crate::Node::Documents(_)),
"Should parse primary TAG handle directive"
);
}
#[test]
fn test_yaml_version_directive() {
let yaml = b"%YAML 1.2\n---\ntest: value\n";
let result = crate::test_helpers::parse_yaml(yaml);
assert!(
matches!(result, crate::Node::Documents(_)),
"Should parse YAML version directive"
);
}
#[test]
fn test_tag_directive_simple() {
let yaml = b"%TAG !e! tag:example.com,2000:\n---\n!e!type value\n";
let result = crate::test_helpers::parse_yaml(yaml);
#[cfg(feature = "debug-trace")]
println!("Simple TAG Result: {:?}", result);
assert!(
matches!(result, crate::Node::Documents(_)),
"Should parse simple TAG directive"
);
}
}