88 "fmt"
99 "os"
1010 "path/filepath"
11+ "slices"
1112 "testing"
1213
1314 "github.com/ava-labs/avalanche-cli/pkg/key"
@@ -669,12 +670,7 @@ func TestPromptChain(t *testing.T) {
669670 mockPrompt := & mocks.Prompter {}
670671 mockPrompt .On ("CaptureListWithSize" , prompt , mock .MatchedBy (func (options []string ) bool {
671672 // Should contain "Custom" option
672- for _ , opt := range options {
673- if opt == Custom {
674- return true
675- }
676- }
677- return false
673+ return slices .Contains (options , Custom )
678674 }), 11 ).Return (Custom , nil ).Once ()
679675 mockPrompt .On ("CaptureString" , "Blockchain ID/Alias" ).Return ("custom-blockchain-id" , nil ).Once ()
680676 notListed , pChain , xChain , cChain , subnetName , blockchainID , err := PromptChain (
@@ -693,12 +689,7 @@ func TestPromptChain(t *testing.T) {
693689 mockPrompt := & mocks.Prompter {}
694690 mockPrompt .On ("CaptureListWithSize" , prompt , mock .MatchedBy (func (options []string ) bool {
695691 // Should contain "My blockchain isn't listed" option
696- for _ , opt := range options {
697- if opt == "My blockchain isn't listed" {
698- return true
699- }
700- }
701- return false
692+ return slices .Contains (options , "My blockchain isn't listed" )
702693 }), 11 ).Return ("My blockchain isn't listed" , nil ).Once ()
703694 notListed , pChain , xChain , cChain , subnetName , blockchainID , err := PromptChain (
704695 mockPrompt , prompt , subnetNames , true , true , true , avoidBlockchainName , false )
0 commit comments