-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
* Add puncuation to comments * ForceLower and MustParse * Revert makefile changes Co-authored-by: Alex Bice <alex.bice@users.noreply.github.com>
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
//go:generate ../bin/go-enum -f=$GOFILE --forcelower | ||
|
||
package example | ||
|
||
// ENUM( | ||
// DataSwap, | ||
// BootNode, | ||
// ) | ||
type ForceLowerType int |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package example | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestForceLowerString(t *testing.T) { | ||
|
||
tests := map[string]struct { | ||
input string | ||
output ForceLowerType | ||
}{ | ||
"dataswap": { | ||
input: `dataswap`, | ||
output: ForceLowerTypeDataSwap, | ||
}, | ||
"bootnode": { | ||
input: `bootnode`, | ||
output: ForceLowerTypeBootNode, | ||
}, | ||
} | ||
|
||
for name, tc := range tests { | ||
t.Run(name, func(t *testing.T) { | ||
output, err := ParseForceLowerType(tc.input) | ||
assert.NoError(t, err) | ||
assert.Equal(t, tc.output, output) | ||
|
||
assert.Equal(t, tc.input, output.String()) | ||
}) | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.