Skip to content

Commit

Permalink
refactor: Test Cases names should be capitalized
Browse files Browse the repository at this point in the history
When reading, parsing test names from file, or reading verbose test
output, a capital test name is much clearer to read and comprehend than
an uncapitalized one. We mimic git commit message subjects in this
sense.
  • Loading branch information
nddeluca committed Jul 30, 2024
1 parent f2f0d6c commit c57e68c
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions x/evm/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func TestInitGenesis(t *testing.T) {
genFixture func(*testing.T, sdk.Context, *app.EthermintApp) testFixture
}{
{
name: "default genesis does not panic",
name: "Default genesis does not panic",
genFixture: func(t *testing.T, ctx sdk.Context, tApp *app.EthermintApp) testFixture {
state := types.DefaultGenesisState()

Expand All @@ -66,7 +66,7 @@ func TestInitGenesis(t *testing.T) {
},
},
{
name: "the chain id is set from the context",
name: "The chain id is set from the context",
genFixture: func(t *testing.T, ctx sdk.Context, tApp *app.EthermintApp) testFixture {
expectFunc := func() {
ctxChainID, err := ethermint.ParseChainID(ctx.ChainID())
Expand All @@ -86,7 +86,7 @@ func TestInitGenesis(t *testing.T) {
},
},
{
name: "an invalid chain id panics",
name: "An invalid chain id panics",
genFixture: func(t *testing.T, ctx sdk.Context, tApp *app.EthermintApp) testFixture {
ctx = ctx.WithChainID("ethermint-1")

Expand All @@ -103,7 +103,7 @@ func TestInitGenesis(t *testing.T) {
},
},
{
name: "parameters are set",
name: "Parameters are set",
genFixture: func(t *testing.T, ctx sdk.Context, tApp *app.EthermintApp) testFixture {
state := types.DefaultGenesisState()

Expand All @@ -126,7 +126,7 @@ func TestInitGenesis(t *testing.T) {
},
},
{
name: "invalid parameters cause a panic",
name: "Invalid parameters cause a panic",
genFixture: func(t *testing.T, ctx sdk.Context, tApp *app.EthermintApp) testFixture {
state := types.DefaultGenesisState()

Expand All @@ -143,7 +143,7 @@ func TestInitGenesis(t *testing.T) {
},
},
{
name: "panics if the evm module account is not already set",
name: "Panics if the evm module account is not already set",
genFixture: func(t *testing.T, ctx sdk.Context, tApp *app.EthermintApp) testFixture {
// Init genesis checks for the module accounts address existance in
// the module account list of permissions (what GetModuleAddress checks).
Expand All @@ -162,7 +162,7 @@ func TestInitGenesis(t *testing.T) {
},
},
{
name: "panics when a genesis account references an account not does not exist",
name: "Panics when a genesis account references an account not does not exist",
genFixture: func(t *testing.T, ctx sdk.Context, tApp *app.EthermintApp) testFixture {
// generate a random address that will not collide with any existing state or accounts
address := generateRandomAddress(t)
Expand All @@ -182,7 +182,7 @@ func TestInitGenesis(t *testing.T) {
},
},
{
name: "panics when a genesis account references a non ethereum account",
name: "Panics when a genesis account references a non ethereum account",
genFixture: func(t *testing.T, ctx sdk.Context, tApp *app.EthermintApp) testFixture {
address := generateRandomAddress(t)

Expand All @@ -206,7 +206,7 @@ func TestInitGenesis(t *testing.T) {
},
},
{
name: "panics when there is a code hash mismatch between auth and evm accounts",
name: "Panics when there is a code hash mismatch between auth and evm accounts",
genFixture: func(t *testing.T, ctx sdk.Context, tApp *app.EthermintApp) testFixture {
address := generateRandomAddress(t)

Expand All @@ -229,7 +229,7 @@ func TestInitGenesis(t *testing.T) {
}
tApp.AccountKeeper.SetAccount(ctx, &acc)

s := "the evm state code doesn't match with the codehash\n"
s := "The evm state code doesn't match with the codehash\n"
expectedPanic := fmt.Sprintf("%s account: %s , evm state codehash: %v, ethAccount codehash: %v, evm state code: %s\n", s, address, codeHash, incorrectCodeHash, codeHex)

return testFixture{
Expand All @@ -242,7 +242,7 @@ func TestInitGenesis(t *testing.T) {
},
},
{
name: "does not panic when there is a code hash mismatch and matching genesis account contains no code",
name: "Does not panic when there is a code hash mismatch and matching genesis account contains no code",
genFixture: func(t *testing.T, ctx sdk.Context, tApp *app.EthermintApp) testFixture {
address := generateRandomAddress(t)

Expand Down Expand Up @@ -271,7 +271,7 @@ func TestInitGenesis(t *testing.T) {
},
},
{
name: "panics when code is set and code hash is empty",
name: "Panics when code is set and code hash is empty",
genFixture: func(t *testing.T, ctx sdk.Context, tApp *app.EthermintApp) testFixture {
address := generateRandomAddress(t)

Expand Down Expand Up @@ -305,7 +305,7 @@ func TestInitGenesis(t *testing.T) {
},
},
{
name: "genesis account code is stored by hash in the keeper state",
name: "Genesis account code is stored by hash in the keeper state",
genFixture: func(t *testing.T, ctx sdk.Context, tApp *app.EthermintApp) testFixture {
address := generateRandomAddress(t)

Expand Down Expand Up @@ -343,7 +343,7 @@ func TestInitGenesis(t *testing.T) {
},
},
{
name: "genesis account storage keys are decoded and stored as bytes in keeper",
name: "Genesis account storage keys are decoded and stored as bytes in keeper",
genFixture: func(t *testing.T, ctx sdk.Context, tApp *app.EthermintApp) testFixture {
address := generateRandomAddress(t)

Expand Down Expand Up @@ -397,7 +397,7 @@ func TestInitGenesis(t *testing.T) {
},
},
{
name: "panics when enabled precompiles are not sorted ascending",
name: "Panics when enabled precompiles are not sorted ascending",
genFixture: func(t *testing.T, ctx sdk.Context, tApp *app.EthermintApp) testFixture {
state := types.DefaultGenesisState()

Expand All @@ -421,7 +421,7 @@ func TestInitGenesis(t *testing.T) {
},
},
{
name: "panics when enabled precompiles are not unique",
name: "Panics when enabled precompiles are not unique",
genFixture: func(t *testing.T, ctx sdk.Context, tApp *app.EthermintApp) testFixture {
state := types.DefaultGenesisState()

Expand All @@ -442,7 +442,7 @@ func TestInitGenesis(t *testing.T) {
},
},
{
name: "panics when enabled precompiles exists but is not registered",
name: "Panics when enabled precompiles exists but is not registered",
genFixture: func(t *testing.T, ctx sdk.Context, tApp *app.EthermintApp) testFixture {
state := types.DefaultGenesisState()

Expand All @@ -465,7 +465,7 @@ func TestInitGenesis(t *testing.T) {
},
},
{
name: "valid enabled precompiles are set in params",
name: "Valid enabled precompiles are set in params",
genFixture: func(t *testing.T, ctx sdk.Context, tApp *app.EthermintApp) testFixture {
state := types.DefaultGenesisState()

Expand Down

0 comments on commit c57e68c

Please sign in to comment.