File tree 2 files changed +4
-12
lines changed
2 files changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -1740,22 +1740,15 @@ mod test {
1740
1740
) ;
1741
1741
}
1742
1742
1743
+ /// Lone closing tags are not allowed, so testing it together with start tag
1743
1744
#[ $test]
1744
- $( $async) ? fn start ( ) {
1745
- let mut reader = Reader :: from_str( "<tag>" ) ;
1745
+ $( $async) ? fn start_and_end ( ) {
1746
+ let mut reader = Reader :: from_str( "<tag></tag> " ) ;
1746
1747
1747
1748
assert_eq!(
1748
1749
reader. $read_event( $buf) $( . $await) ? . unwrap( ) ,
1749
1750
Event :: Start ( BytesStart :: new( "tag" ) )
1750
1751
) ;
1751
- }
1752
-
1753
- #[ $test]
1754
- $( $async) ? fn end( ) {
1755
- let mut reader = Reader :: from_str( "</tag>" ) ;
1756
- // Because we expect invalid XML, do not check that
1757
- // the end name paired with the start name
1758
- reader. check_end_names( false ) ;
1759
1752
1760
1753
assert_eq!(
1761
1754
reader. $read_event( $buf) $( . $await) ? . unwrap( ) ,
Original file line number Diff line number Diff line change @@ -170,15 +170,14 @@ impl ReaderState {
170
170
171
171
self . opened_buffer . truncate ( start) ;
172
172
}
173
- None if self . check_end_names => {
173
+ None => {
174
174
// Report error at start of the end tag at `<` character
175
175
// +2 for `<` and `>`
176
176
self . offset -= buf. len ( ) + 2 ;
177
177
return Err ( Error :: IllFormed ( IllFormedError :: UnmatchedEnd (
178
178
decoder. decode ( name) . unwrap_or_default ( ) . into_owned ( ) ,
179
179
) ) ) ;
180
180
}
181
- None => { }
182
181
}
183
182
184
183
Ok ( Event :: End ( BytesEnd :: wrap ( name. into ( ) ) ) )
You can’t perform that action at this time.
0 commit comments