Source code of DERO Merchant
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
510B

  1. package stringutil
  2. import (
  3. "testing"
  4. "github.com/stretchr/testify/assert"
  5. )
  6. func TestBuild(t *testing.T) {
  7. tests := []struct {
  8. Strings []string
  9. Expected string
  10. }{
  11. {
  12. Strings: []string{"", ""},
  13. Expected: "",
  14. },
  15. {
  16. Strings: []string{"foo", "bar"},
  17. Expected: "foobar"},
  18. {
  19. Strings: []string{"foo ", "bar ", "baz"},
  20. Expected: "foo bar baz"},
  21. }
  22. var actual string
  23. for _, test := range tests {
  24. actual = Build(test.Strings...)
  25. assert.Equal(t, test.Expected, actual)
  26. }
  27. }