1
0
mirror of https://github.com/drone/drone-cli.git synced 2026-01-17 16:31:34 +01:00
drone-cli/drone/internal/util_test.go
2017-05-15 13:59:26 +02:00

18 lines
444 B
Go

package internal
import "testing"
func TestParseKeyPair(t *testing.T) {
s := []string{"FOO=bar", "BAR=", "INVALID"}
p := ParseKeyPair(s)
if p["FOO"] != "bar" {
t.Errorf("Wanted %q, got %q.", "bar", p["FOO"])
}
if _, exists := p["BAR"]; !exists {
t.Error("Missing a key with no value. Keys with empty values are also valid.")
}
if _, exists := p["INVALID"]; exists {
t.Error("Keys without an equal sign suffix are invalid.")
}
}