ox icon indicating copy to clipboard operation
ox copied to clipboard

`Start End Mismatch: element X not closed` errors in sax_test

Open jirutka opened this issue 1 year ago • 2 comments

   [:start_element, :child],
   [:end_element, :child],
?  [:error, "Start End Mismatch: element 'top   ' not closed", 4, 0],
?                                         (null)
?                                         ???
   [:end_element, :top]]
===============================================================================
....................................................3: [:error, "Start End Mismatch: element 'top' not closed", 1, 23] != [:error, "Start End Mismatch: element '(null)' not closed", 1, 23]

expected: [[:start_element, :top], [:error, "Not Terminated: text not terminated", 1, 23], [:text, "This is some text."], [:error, "Start End Mismatch: element 'top' not closed", 1, 23], [:end_element, :top]]
  actual: [[:start_element, :top], [:error, "Not Terminated: text not terminated", 1, 23], [:text, "This is some text."], [:error, "Start End Mismatch: element '(null)' not closed", 1, 23], [:end_element, :top]]
F
===============================================================================
Failure: test_sax_text_no_term(SaxBaseTest)
/home/jirutjak/aports/community/ruby-ox/src/ox-2.14.16/test/sax/helpers.rb:37:in `parse_compare'
./test/sax/sax_test.rb:565:in `test_sax_text_no_term'
     562:
     563:   def test_sax_text_no_term
     564:     Ox.default_options = $ox_sax_options
  => 565:     parse_compare(%{<top>This is some text.},
     566:                   [
     567:                     [:start_element, :top],
     568:                     [:error, 'Not Terminated: text not terminated', 1, 23],
<[[:start_element, :top],
 [:error, "Not Terminated: text not terminated", 1, 23],
 [:text, "This is some text."],
 [:error, "Start End Mismatch: element 'top' not closed", 1, 23],
 [:end_element, :top]]> expected but was
<[[:start_element, :top],
 [:error, "Not Terminated: text not terminated", 1, 23],
 [:text, "This is some text."],
 [:error, "Start End Mismatch: element '(null)' not closed", 1, 23],
 [:end_element, :top]]>

diff:
  [[:start_element, :top],
   [:error, "Not Terminated: text not terminated", 1, 23],
   [:text, "This is some text."],
?  [:error, "Start End Mismatch: element 'top   ' not closed", 1, 23],
?                                         (null)
?                                         ???
   [:end_element, :top]]
===============================================================================
..........
Finished in 0.038616298 seconds.
-------------------------------------------------------------------------------
88 tests, 100 assertions, 3 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
96.5909% passed
-------------------------------------------------------------------------------
2278.83 tests/s, 2589.58 assertions/s

Environment:

  • ox 2.14.16
  • Ruby 3.2.2
  • gcc 12.2
  • Alpine Linux Edge x86_64

jirutka avatar Apr 22 '23 15:04 jirutka

I'll look into it to see what changed.

ohler55 avatar Apr 22 '23 16:04 ohler55

The develop branch should now pass the tests.

ohler55 avatar Apr 23 '23 19:04 ohler55