github.com/msales/pkg/v3@v3.24.0/clix/flags_test.go (about)

     1  package clix_test
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/msales/pkg/v3/clix"
     7  	"github.com/stretchr/testify/assert"
     8  	"gopkg.in/urfave/cli.v1"
     9  )
    10  
    11  func TestFlags_Merge(t *testing.T) {
    12  	f1 := cli.StringFlag{}
    13  	f2 := cli.StringFlag{}
    14  	f3 := cli.StringFlag{}
    15  	flags1 := clix.Flags{f1}
    16  	flags2 := clix.Flags{f2}
    17  	flags3 := clix.Flags{f3}
    18  
    19  	merged := flags1.Merge(flags2, flags3)
    20  
    21  	assert.IsType(t, clix.Flags{}, merged)
    22  	assert.Len(t, merged, 3)
    23  	assert.Contains(t, flags1, f1)
    24  	assert.Contains(t, flags1, f2)
    25  	assert.Contains(t, flags1, f3)
    26  }