Add test for comment only

This commit is contained in:
dalance 2020-04-12 11:59:48 +09:00
parent 78a66bf6ae
commit 32d76fab53

View File

@ -249,3 +249,17 @@ macro_rules! unwrap_locate {
unwrap()
}};
}
#[cfg(test)]
mod test {
use super::*;
#[test]
fn test() {
let src = "/* comment */";
let (syntax_tree, _) =
parse_sv_str(src, PathBuf::from(""), &HashMap::new(), &[""], false).unwrap();
let comment = unwrap_node!(&syntax_tree, Comment);
assert!(comment.is_some());
}
}