github.com/pingcap/tiup@v1.15.1/components/dm/command/deploy_test.go (about) 1 package command 2 3 import ( 4 "testing" 5 6 "github.com/stretchr/testify/require" 7 ) 8 9 func TestSupportVersion(t *testing.T) { 10 assert := require.New(t) 11 12 tests := map[string]bool{ // version to support or not 13 "v2.0.0": true, 14 "v6.0.0": true, 15 "v1.0.1": false, 16 "v1.1.1": false, 17 } 18 19 for v, support := range tests { 20 err := supportVersion(v) 21 if support { 22 assert.Nil(err) 23 } else { 24 assert.NotNil(err) 25 } 26 } 27 }