Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minify XML tests break with 2.4.0 #56

Closed
QuLogic opened this issue Jan 2, 2020 · 2 comments
Closed

Minify XML tests break with 2.4.0 #56

QuLogic opened this issue Jan 2, 2020 · 2 comments

Comments

@QuLogic
Copy link

QuLogic commented Jan 2, 2020

An automated rebuild of minify against parse 2.4.0 fails as:

github.com/tdewolff/minify/xml
--- FAIL: TestXML (0.00s)
    --- FAIL: TestXML/<A>x</A> (0.00s)
    xml_test.go:56:: 
            <A>x</A>
            <Ax</A>
            <A>x</A>
    --- FAIL: TestXML/<a><b>x</b></a> (0.00s)
    xml_test.go:56:: 
            <a><b>x</b></a>
            <a<bx</b></a>
            <a><b>x</b></a>
    --- FAIL: TestXML/<a><b>x_y</b></a> (0.00s)
    xml_test.go:56:: 
            <a><b>x\ny</b></a>
            <a<bx\ny</b></a>
            <a><b>x\ny</b></a>
    --- FAIL: TestXML/<a>_<![CDATA[_a_]]>_</a> (0.00s)
    xml_test.go:56:: 
            <a> <![CDATA[ a ]]> </a>
            <aa</a>
            <a>a</a>
    --- FAIL: TestXML/<a_>a</a_> (0.00s)
    xml_test.go:56:: 
            <a >a</a >
            <aa</a>
            <a>a</a>
    --- FAIL: TestXML/<?xml__version="1.0"_?> (0.00s)
    xml_test.go:56:: 
            <?xml  version="1.0" ?>
            <?xml version="1.0"
            <?xml version="1.0"?>
    --- FAIL: TestXML/<x_a="_a_____b_"/> (0.00s)
    xml_test.go:56:: 
            <x a=" a \n\r\t b "/>
            <x a=" a     b "
            <x a=" a     b "/>
    --- FAIL: TestXML/<x>&amp;&lt;&gt;</x> (0.00s)
    xml_test.go:56:: 
            <x>&amp;&lt;&gt;</x>
            <x&amp;&lt;></x>
            <x>&amp;&lt;></x>
    --- FAIL: TestXML/<!doctype_html> (0.00s)
    xml_test.go:56:: 
            <!doctype html>
            <!doctype html=
            <!doctype html=>
    --- FAIL: TestXML/<x>_<!--y-->_</x> (0.00s)
    xml_test.go:56:: 
            <x>\n<!--y-->\n</x>
            <x</x>
            <x></x>
    --- FAIL: TestXML/<style>lala{color:red}</style> (0.00s)
    xml_test.go:56:: 
            <style>lala{color:red}</style>
            <stylelala{color:red}</style>
            <style>lala{color:red}</style>
--- FAIL: TestXMLKeepWhitespace (0.00s)
    --- FAIL: TestXMLKeepWhitespace/_<div>_<i>_test_</i>_<b>_test_</b>_</div>_ (0.00s)
    xml_test.go:84:: 
             <div> <i> test </i> <b> test </b> </div> 
            <div <i test </i> <b test </b> </div>
            <div> <i> test </i> <b> test </b> </div>
    --- FAIL: TestXMLKeepWhitespace/<x>_<!--y-->_</x> (0.00s)
    xml_test.go:84:: 
            <x>\n<!--y-->\n</x>
            <x\n</x>
            <x>\n</x>
    --- FAIL: TestXMLKeepWhitespace/<style>lala{color:red}</style> (0.00s)
    xml_test.go:84:: 
            <style>lala{color:red}</style>
            <stylelala{color:red}</style>
            <style>lala{color:red}</style>
    --- FAIL: TestXMLKeepWhitespace/<x>_<?xml?>_</x> (0.00s)
    xml_test.go:84:: 
            <x> <?xml?> </x>
            <x<?xml </x>
            <x><?xml?> </x>
    --- FAIL: TestXMLKeepWhitespace/<x>_<![CDATA[_x_]]>_</x> (0.00s)
    xml_test.go:84:: 
            <x> <![CDATA[ x ]]> </x>
            <x x </x>
            <x> x </x>
    --- FAIL: TestXMLKeepWhitespace/<x>_<![CDATA[_<<<<<_]]>_</x> (0.00s)
    xml_test.go:84:: 
            <x> <![CDATA[ <<<<< ]]> </x>
            <x<![CDATA[ <<<<< ]]></x>
            <x><![CDATA[ <<<<< ]]></x>
FAIL
exit status 1
FAIL	github.com/tdewolff/minify/xml	0.004s

The first tag seems to be missing its closing >.

@tdewolff
Copy link
Owner

tdewolff commented Jan 2, 2020

You should make sure to use the correct versions of parse and minify. Either use the latest commit to master for both (not recommended due to breaking changes) or use the latest version of minify which currently uses parse@v2.3.14 (see go.mod). Hope that helps.

@tdewolff
Copy link
Owner

tdewolff commented Jan 2, 2020

Actually, the release of minify against parse@v2.3.14 had the same issue due to an outstanding fix. I've published new versions of parse and minify that should work! Sorry for the hassle, reopen issue if you still experience problems.

@tdewolff tdewolff closed this as completed Jan 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants