mirror of
https://github.com/joshuadavidthomas/django-language-server.git
synced 2025-09-12 13:26:51 +00:00
add test for void html tag
This commit is contained in:
parent
cff90ee869
commit
61b55641cb
2 changed files with 20 additions and 0 deletions
|
@ -557,6 +557,15 @@ mod tests {
|
|||
insta::assert_yaml_snapshot!(ast);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_parse_html_void() {
|
||||
let source = r#"<img src="example.png" />"#;
|
||||
let tokens = Lexer::new(source).tokenize().unwrap();
|
||||
let mut parser = Parser::new(tokens);
|
||||
let ast = parser.parse().unwrap();
|
||||
insta::assert_yaml_snapshot!(ast);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_parse_script() {
|
||||
let source = r#"<script type="text/javascript">
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
source: crates/djls-ast/src/parser.rs
|
||||
expression: ast
|
||||
---
|
||||
nodes:
|
||||
- Html:
|
||||
Void:
|
||||
tag_name: img
|
||||
attributes:
|
||||
src:
|
||||
Value: example.png
|
Loading…
Add table
Add a link
Reference in a new issue