mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
tests: cleanup test cases (#19104)
This commit is contained in:
parent
a711e17f41
commit
11a8a46ade
52 changed files with 131 additions and 184 deletions
|
@ -2,7 +2,7 @@ module html
|
|||
|
||||
fn test_parse() {
|
||||
doc := parse('<html><body><h1 class="title">Hello world!</h1></body></html>')
|
||||
tags := doc.get_tag('h1')
|
||||
tags := doc.get_tags(name: 'h1')
|
||||
assert tags.len == 1
|
||||
h1_tag := tags[0] // <h1>Hello world!</h1>
|
||||
assert h1_tag.name == 'h1'
|
||||
|
@ -16,13 +16,13 @@ fn test_parse() {
|
|||
|
||||
fn test_parse_inline_tags() {
|
||||
doc := parse('<html><body><p>before <span>in between</span> after</p></body></html>')
|
||||
tags := doc.get_tag('span')
|
||||
tags := doc.get_tags(name: 'span')
|
||||
assert tags.len == 1
|
||||
|
||||
span_tag := tags[0]
|
||||
assert span_tag.str() == '<span>in between</span>'
|
||||
|
||||
p_tags := doc.get_tag('p')
|
||||
p_tags := doc.get_tags(name: 'p')
|
||||
assert p_tags.len == 1
|
||||
|
||||
p_tag := p_tags[0]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue