Skip to content

Go1.16 stdlib test fixes: sync/atomic, io, internal/unsafeheader, internal/fmtsort, and type assertion errors. #1004

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

Merged
merged 8 commits into from
Mar 22, 2021

Conversation

nevkontakte
Copy link
Member

@nevkontakte nevkontakte commented Mar 22, 2021

For the most part this PR includes test skips for cases that are either irrelevant or caused by pre-existing GopherJS bugs. I also found and fixed a couple of regressions in the runtime package that were introduced earlier in this branch.

Updates #989.

This is a regression introduced in e1112ef, which was causing
TestNilInterfaceError in ./tests package to fail.
This is another regression introduced in e1112ef, this error is
actually used in prelude's $assertType function, along with a fake
`_type` struct.

Admittedly, this isn't the best fix, but reconciling type information
with the reflect types is a rabbit hole I'm unwilling to jump into right
now.
A new test case involving unsafe.Pointer was added, which we have to
skip, since GopherJS doesn't support raw pointers. However, I also added
rudimentary support for calling `reflect.Value.Convert()` with
`unsafe.Pointer` to make sure the test doesn't panic.
This test relies on assumptions about string and slice implementation
that do not in fact hold true for GopherJS.
Due to an incorrectly passing type assertion the test triggers a code
path that panics instead of returning an error, which causes the test to
fail. In the grand scheme of things there's nothing wrong with the io
package though.
GopherJS runtime doesn't provide access to low-level details such as
alignment, and atomics are emulated anyway.
This applies to both GOROOT and GOPHERJS_GOROOT. The motivation behind
the change is that setting a variable to an empty value is a common way
of "unsetting" it and most tools treat it that way.
@nevkontakte nevkontakte requested a review from flimzy March 22, 2021 13:28
@nevkontakte nevkontakte merged commit 3f0bf36 into gopherjs:go1.16-stdlib Mar 22, 2021
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

Successfully merging this pull request may close these issues.

2 participants