go-xml icon indicating copy to clipboard operation
go-xml copied to clipboard

Tests generated for `gentests/books/books_test.go` do not pass

Open tsmith-rv opened this issue 3 years ago • 0 comments

When pulling the latest code (https://github.com/droyo/go-xml/commit/d9421b29381771b31dcc35151bdc554d586f1e60), the tests for books pass until you actually generate new tests using gentests/gentest.go, at which point the tests fail. The response looks like:

=== RUN   TestBooks
    books_test.go:48: got 
        <Document>
          <books xmlns="urn:books">
            <book name="bk001" xmlns="urn:books" xmlns:_="urn:books">
              <author xmlns="urn:books">Writer</author>
              <genre xmlns="urn:books">Fiction</genre>
              <price xmlns="urn:books">44.95</price>
              <pub_date xmlns="urn:books">2000-10-01Z</pub_date>
              <review xmlns="urn:books">An amazing story of nothing.</review>
              <title xmlns="urn:books">The First Book</title>
            </book>
            <book name="bk002" xmlns="urn:books" xmlns:_="urn:books">
              <author xmlns="urn:books">Poet</author>
              <title xmlns="urn:books">The Poets First Poem</title>
              <genre xmlns="urn:books">Poem</genre>
              <price xmlns="urn:books">24.95</price>
              <review xmlns="urn:books">Least poetic poems.</review>
              <pub_date xmlns="urn:books">2003-12-01Z</pub_date>
            </book>
          </books>
        </Document>
        
        , wanted 
        <Document>
          <books xmlns="urn:books" xmlns:books="urn:books">
            <book name="bk001">
              <author>Writer</author>
              <genre>Fiction</genre>
              <price>44.95</price>
              <pub_date>2000-10-01</pub_date>
              <review>An amazing story of nothing.</review>
              <title>The First Book</title>
            </book>
            <book name="bk002">
              <author>Poet</author>
              <title>The Poets First Poem</title>
              <genre>Poem</genre>
              <price>24.95</price>
              <review>Least poetic poems.</review>
              <pub_date>2003-12-01</pub_date>
            </book>
          </books>
        </Document>
        
--- FAIL: TestBooks (0.00s)

FAIL

Process finished with the exit code 1

Going back through previous commits it seems that https://github.com/droyo/go-xml/commit/0649c2cb6cad0e0aeb0e7db052db25e783cf9750 is where the tests in books start to fail like this when generating the tests.

tsmith-rv avatar Mar 31 '22 11:03 tsmith-rv