github.com/Finschia/finschia-sdk@v0.48.1/x/gov/types/proposals_test.go (about) 1 package types 2 3 import ( 4 "fmt" 5 "testing" 6 7 "github.com/stretchr/testify/require" 8 ) 9 10 func TestProposalStatus_Format(t *testing.T) { 11 statusDepositPeriod, _ := ProposalStatusFromString("PROPOSAL_STATUS_DEPOSIT_PERIOD") 12 tests := []struct { 13 pt ProposalStatus 14 sprintFArgs string 15 expectedStringOutput string 16 }{ 17 {statusDepositPeriod, "%s", "PROPOSAL_STATUS_DEPOSIT_PERIOD"}, 18 {statusDepositPeriod, "%v", "1"}, 19 } 20 for _, tt := range tests { 21 got := fmt.Sprintf(tt.sprintFArgs, tt.pt) 22 require.Equal(t, tt.expectedStringOutput, got) 23 } 24 }