add decoding tests for trilean
This commit is contained in:
parent
2efc94521b
commit
db880ab50a
|
@ -13,6 +13,7 @@ func TestDecode(t *testing.T) {
|
|||
Name string
|
||||
Address string
|
||||
Time time.Duration
|
||||
Trilean Trilean
|
||||
}
|
||||
|
||||
cases := map[string]struct {
|
||||
|
@ -23,13 +24,27 @@ func TestDecode(t *testing.T) {
|
|||
"basic": {
|
||||
[]interface{}{
|
||||
map[string]interface{}{
|
||||
"name": "bar",
|
||||
"time": "5s",
|
||||
"name": "bar",
|
||||
"time": "5s",
|
||||
"trilean": "true",
|
||||
},
|
||||
},
|
||||
&Target{
|
||||
Name: "bar",
|
||||
Time: 5 * time.Second,
|
||||
Name: "bar",
|
||||
Time: 5 * time.Second,
|
||||
Trilean: TriTrue,
|
||||
},
|
||||
nil,
|
||||
},
|
||||
|
||||
"empty-string-trilean": {
|
||||
[]interface{}{
|
||||
map[string]interface{}{
|
||||
"trilean": "",
|
||||
},
|
||||
},
|
||||
&Target{
|
||||
Trilean: TriUnset,
|
||||
},
|
||||
nil,
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue