opts: use string-literals for easier grep'ing

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2023-07-05 12:24:11 +02:00
parent ddec605aef
commit 84000190d3
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -71,10 +71,10 @@ func TestListOptsWithoutValidator(t *testing.T) {
t.Errorf("%d != 3", o.Len())
}
if !o.Get("bar") {
t.Error("o.Get(\"bar\") == false")
t.Error(`o.Get("bar") == false`)
}
if o.Get("baz") {
t.Error("o.Get(\"baz\") == true")
t.Error(`o.Get("baz") == true`)
}
o.Delete("foo")
if o.String() != "[bar bar]" {
@ -106,10 +106,10 @@ func TestListOptsWithValidator(t *testing.T) {
t.Errorf("%d != 1", o.Len())
}
if !o.Get("max-file=2") {
t.Error("o.Get(\"max-file=2\") == false")
t.Error(`o.Get("max-file=2") == false`)
}
if o.Get("baz") {
t.Error("o.Get(\"baz\") == true")
t.Error(`o.Get("baz") == true`)
}
o.Delete("max-file=2")
if o.String() != "" {
@ -361,7 +361,7 @@ func TestMapMapOpts(t *testing.T) {
o.Set("r1=k12=v12")
assert.Check(t, is.DeepEqual(tmpMap["r1"], map[string]string{"k11": "v11", "k12": "v12"}))
if o.Set("invalid-key={\"k\":\"v\"}") == nil {
if o.Set(`invalid-key={"k":"v"}`) == nil {
t.Error("validator is not being called")
}
}