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