lunixbochs / struc

Better binary packing for Go
MIT License
576 stars 45 forks source link

Convert custom type tests to table driven subtests #64

Closed 13rac1 closed 5 years ago

13rac1 commented 5 years ago

Adds many permutation of using custom types, all unimplemented features have been skipped. The missing functionality should panic to reduce developer confusion, but I'm leaving that out in an effort to reduce the scope and LOCdiff.

Includes two workarounds for lack of T.Run() in Go <1.7

lunixbochs commented 5 years ago

merged, thanks. we can circle back to #63, I basically just want to know which tests are and aren't passing under the PR.

13rac1 commented 5 years ago

I basically just want to know which tests are and aren't passing under the PR.

Haha! https://github.com/golang/go/issues/25951 would be so helpful in this case.

lunixbochs commented 5 years ago

In your custom runner you can make skip just log a warning instead of failing

On Mar 26, 2019, at 10:32 AM, Brad Erickson notifications@github.com wrote:

I basically just want to know which tests are and aren't passing under the PR.

Haha! golang/go#25951 would be so helpful in this case.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.

13rac1 commented 5 years ago

Yes, but Skip() won't tell you about unexpected pass/fail. It just doesn't run the test case. I want to write tests which fail CI when they start working, so they get cleaned up.

lunixbochs commented 5 years ago

You're not calling Skip(). You can do whatever you want here: https://github.com/lunixbochs/struc/pull/64/commits/049294c40276d06b450197710a37139111d984a3#diff-3df1114f2fd22239fbcd3a8751375101R296

13rac1 commented 5 years ago

:laughing: Sorry, I misunderstood.

It doesn't fail right now. It just skips the sub-test like Skip() would if I could use it. I can re-implement workarounds for not having ExpectFail(), but it's ok.