-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change generated binary to 1.18 (#91)
* Update to support go 1.18 stuff * add new tests * change release to use 1.18 * fix older versions * drop support of 1.13 * up the code coverage
- Loading branch information
Showing
27 changed files
with
8,749 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package example | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestEnum32Bit(t *testing.T) { | ||
|
||
tests := map[string]struct { | ||
input string | ||
output Enum32bit | ||
}{ | ||
"E2P15": { | ||
input: `E2P15`, | ||
output: Enum32bitE2P15, | ||
}, | ||
"E2P30": { | ||
input: `E2P30`, | ||
output: Enum32bitE2P30, | ||
}, | ||
} | ||
|
||
for name, tc := range tests { | ||
t.Run(name, func(t *testing.T) { | ||
output, err := ParseEnum32bit(tc.input) | ||
assert.NoError(t, err) | ||
assert.Equal(t, tc.output, output) | ||
|
||
assert.Equal(t, tc.input, output.String()) | ||
}) | ||
} | ||
|
||
t.Run("basics", func(t *testing.T) { | ||
assert.Equal(t, "E2P23", Enum32bitE2P23.String()) | ||
assert.Equal(t, "Enum32bit(99)", Enum32bit(99).String()) | ||
_, err := ParseEnum32bit("-1") | ||
assert.Error(t, err) | ||
|
||
names := Enum32bitNames() | ||
assert.Len(t, names, 12) | ||
}) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package example | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestEnum64Bit(t *testing.T) { | ||
|
||
tests := map[string]struct { | ||
input string | ||
output Enum64bit | ||
}{ | ||
"E2P15": { | ||
input: `E2P15`, | ||
output: Enum64bitE2P15, | ||
}, | ||
"E2P63": { | ||
input: `E2P63`, | ||
output: Enum64bitE2P63, | ||
}, | ||
} | ||
|
||
for name, tc := range tests { | ||
t.Run(name, func(t *testing.T) { | ||
output, err := ParseEnum64bit(tc.input) | ||
assert.NoError(t, err) | ||
assert.Equal(t, tc.output, output) | ||
|
||
assert.Equal(t, tc.input, output.String()) | ||
}) | ||
} | ||
|
||
t.Run("basics", func(t *testing.T) { | ||
assert.Equal(t, "E2P23", Enum64bitE2P23.String()) | ||
assert.Equal(t, "Enum64bit(99)", Enum64bit(99).String()) | ||
_, err := ParseEnum64bit("-1") | ||
assert.Error(t, err) | ||
|
||
names := Enum64bitNames() | ||
assert.Len(t, names, 16) | ||
}) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.