8
8
"fmt"
9
9
"os"
10
10
"path/filepath"
11
+ "slices"
11
12
"testing"
12
13
13
14
"github.com/ava-labs/avalanche-cli/pkg/key"
@@ -669,12 +670,7 @@ func TestPromptChain(t *testing.T) {
669
670
mockPrompt := & mocks.Prompter {}
670
671
mockPrompt .On ("CaptureListWithSize" , prompt , mock .MatchedBy (func (options []string ) bool {
671
672
// 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 )
678
674
}), 11 ).Return (Custom , nil ).Once ()
679
675
mockPrompt .On ("CaptureString" , "Blockchain ID/Alias" ).Return ("custom-blockchain-id" , nil ).Once ()
680
676
notListed , pChain , xChain , cChain , subnetName , blockchainID , err := PromptChain (
@@ -693,12 +689,7 @@ func TestPromptChain(t *testing.T) {
693
689
mockPrompt := & mocks.Prompter {}
694
690
mockPrompt .On ("CaptureListWithSize" , prompt , mock .MatchedBy (func (options []string ) bool {
695
691
// 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" )
702
693
}), 11 ).Return ("My blockchain isn't listed" , nil ).Once ()
703
694
notListed , pChain , xChain , cChain , subnetName , blockchainID , err := PromptChain (
704
695
mockPrompt , prompt , subnetNames , true , true , true , avoidBlockchainName , false )
0 commit comments