1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/opts/quotedstring_test.go

25 lines
592 B
Go
Raw Normal View History

package opts
import (
"github.com/docker/docker/pkg/testutil/assert"
"testing"
)
func TestQuotedStringSetWithQuotes(t *testing.T) {
qs := QuotedString("")
assert.NilError(t, qs.Set("\"something\""))
assert.Equal(t, qs.String(), "something")
}
func TestQuotedStringSetWithMismatchedQuotes(t *testing.T) {
qs := QuotedString("")
assert.NilError(t, qs.Set("\"something'"))
assert.Equal(t, qs.String(), "\"something'")
}
func TestQuotedStringSetWithNoQuotes(t *testing.T) {
qs := QuotedString("")
assert.NilError(t, qs.Set("something"))
assert.Equal(t, qs.String(), "something")
}