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

TestDeferredContainer is break on master branch #54

Open
NexZhu opened this issue Apr 1, 2021 · 3 comments
Open

TestDeferredContainer is break on master branch #54

NexZhu opened this issue Apr 1, 2021 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@NexZhu
Copy link
Contributor

NexZhu commented Apr 1, 2021

The following test outputs errors on master branch

func TestDeferredContainer(t *testing.T) {
	zero := &DeferredContainer{}
	recepticle := &DeferredContainer{}
	testValueRoundtrip(t, zero, recepticle)
}

Output:

=== RUN   TestDeferredContainer
    roundtrip_test.go:62: &testing.DeferredContainer{Stuff:(*testing.SimpleTypeOne)(nil), Deferred:(*typegen.Deferred)(nil), Value:0x0} != &testing.DeferredContainer{Stuff:(*testing.SimpleTypeOne)(nil), Deferred:(*typegen.Deferred)(0xc000004780), Value:0x0}
    roundtrip_test.go:63: not equal after round trip!
--- PASS: TestDeferredContainer (0.00s)
PASS
@Stebalien
Copy link
Collaborator

Looks like this was broken in #16. cc @whyrusleeping?

@whyrusleeping
Copy link
Owner

Ah, looks like its always allocating a deferred object now. Doesnt seem like wrong behaviour, maybe we should adjust the test?

@Stebalien
Copy link
Collaborator

Well, it's not behaving like any of the other "null" cases. But I agree that the current code is probably safer (and doesn't affect the final encoding).

@Stebalien Stebalien added the bug Something isn't working label Apr 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants