diff options
| author | Robert Griesemer <gri@google.com> | 2026-03-11 19:02:07 -0700 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2026-03-20 10:43:51 -0700 |
| commit | 51abbb12c478ad44949367c0c478ee8f87c1f6bf (patch) | |
| tree | 173df53cc830b14dbe36251b5e00a7075008f306 /src/internal/pkgbits/pkgbits_test.go | |
| parent | 79f3d38562bb62221313aacaf1b8d18178b1ff67 (diff) | |
| download | go-51abbb12c478ad44949367c0c478ee8f87c1f6bf.tar.xz | |
internal/pkgbits: add missing tests
The encoding version was recently bumped to V3
but the tests were not updated. Do it now.
For #9859.
Change-Id: Ia61d3e178215e804dcd2db186774883617e5e5a4
Reviewed-on: https://go-review.googlesource.com/c/go/+/757440
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
Diffstat (limited to 'src/internal/pkgbits/pkgbits_test.go')
| -rw-r--r-- | src/internal/pkgbits/pkgbits_test.go | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/internal/pkgbits/pkgbits_test.go b/src/internal/pkgbits/pkgbits_test.go index f67267189f..b6e421e738 100644 --- a/src/internal/pkgbits/pkgbits_test.go +++ b/src/internal/pkgbits/pkgbits_test.go @@ -15,6 +15,7 @@ func TestRoundTrip(t *testing.T) { pkgbits.V0, pkgbits.V1, pkgbits.V2, + pkgbits.V3, } { pw := pkgbits.NewPkgEncoder(version, -1) w := pw.NewEncoder(pkgbits.SectionMeta, pkgbits.SyncPublic) @@ -33,9 +34,13 @@ func TestRoundTrip(t *testing.T) { } } -// Type checker to enforce that know V* have the constant values they must have. -var _ [0]bool = [pkgbits.V0]bool{} -var _ [1]bool = [pkgbits.V1]bool{} +// Type checker to enforce that known V* have the constant values they must have. +var ( + _ [0]bool = [pkgbits.V0]bool{} + _ [1]bool = [pkgbits.V1]bool{} + _ [2]bool = [pkgbits.V2]bool{} + _ [3]bool = [pkgbits.V3]bool{} +) func TestVersions(t *testing.T) { type vfpair struct { @@ -54,6 +59,7 @@ func TestVersions(t *testing.T) { {pkgbits.V0, pkgbits.DerivedInfoNeeded}, {pkgbits.V1, pkgbits.DerivedInfoNeeded}, {pkgbits.V2, pkgbits.AliasTypeParamNames}, + {pkgbits.V3, pkgbits.CompactCompLiterals}, } { if !c.v.Has(c.f) { t.Errorf("Expected version %v to have field %v", c.v, c.f) @@ -68,6 +74,9 @@ func TestVersions(t *testing.T) { {pkgbits.V2, pkgbits.DerivedInfoNeeded}, {pkgbits.V0, pkgbits.AliasTypeParamNames}, {pkgbits.V1, pkgbits.AliasTypeParamNames}, + {pkgbits.V0, pkgbits.CompactCompLiterals}, + {pkgbits.V1, pkgbits.CompactCompLiterals}, + {pkgbits.V2, pkgbits.CompactCompLiterals}, } { if c.v.Has(c.f) { t.Errorf("Expected version %v to not have field %v", c.v, c.f) |
