plugin_test.go 924 B

1234567891011121314151617181920212223242526272829
  1. package plugin
  2. import (
  3. "testing"
  4. "github.com/stretchr/testify/assert"
  5. )
  6. func TestGetPluginAndArgs(t *testing.T) {
  7. bin, args := getPluginAndArgs("android")
  8. assert.Equal(t, "android", bin)
  9. assert.Equal(t, "", args)
  10. bin, args = getPluginAndArgs("android=")
  11. assert.Equal(t, "android", bin)
  12. assert.Equal(t, "", args)
  13. bin, args = getPluginAndArgs("android=-javaPackage com.tal")
  14. assert.Equal(t, "android", bin)
  15. assert.Equal(t, "-javaPackage com.tal", args)
  16. bin, args = getPluginAndArgs("android=-javaPackage com.tal --lambda")
  17. assert.Equal(t, "android", bin)
  18. assert.Equal(t, "-javaPackage com.tal --lambda", args)
  19. bin, args = getPluginAndArgs(`https://test-xjy-file.obs.cn-east-2.myhuaweicloud.com/202012/8a7ab6e1-e639-49d1-89cf-2ae6127a1e90n=-v 1`)
  20. assert.Equal(t, "https://test-xjy-file.obs.cn-east-2.myhuaweicloud.com/202012/8a7ab6e1-e639-49d1-89cf-2ae6127a1e90n", bin)
  21. assert.Equal(t, "-v 1", args)
  22. }