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

mime: TestExtensionsByTypeMultiple broken on windows #10278

Closed
cookieo9 opened this issue Mar 28, 2015 · 2 comments
Closed

mime: TestExtensionsByTypeMultiple broken on windows #10278

cookieo9 opened this issue Mar 28, 2015 · 2 comments
Milestone

Comments

@cookieo9
Copy link
Contributor

On my windows machine (Windows 8.1 64-bit), the TestExtensionsByTypeMultiple test breaks consistently with the following error at tip:

--- FAIL: TestExtensionsByTypeMultiple (0.00s)
        type_test.go:76: ExtensionsByType("text/html") = [.htm .html .shtml]; want [.htm .html]

This is likely the result of the MIME types map being made using data from the registry, and my system having an extra entry for text/html that the test wasn't expecting.

I did not add the entry manually myself, so it's either a default for my version of the OS (compared to the builder's) or an addition made by a program I installed. Either case, the test should be probably be made more robust, or ignore the registry's mime-entries during testing.

@bradfitz bradfitz added this to the Go1.5 milestone Mar 28, 2015
@bradfitz
Copy link
Contributor

Thanks.

These tests need to be more insulated. They're testing too many unrelated things at once. The types_test.go tests are mixing testing the various functions and also testing parsing the OS-specific text files. Those need to be separate tests, and tests like TestExtensionsByTypeMultiple need to be testing just those functions on static data baked into the tests and not let OS-specific differences creep in.

@bradfitz
Copy link
Contributor

@golang golang locked and limited conversation to collaborators Jun 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants