diff options
| author | Rose Hogenson <rosehogenson@posteo.net> | 2025-11-24 16:12:09 -0800 |
|---|---|---|
| committer | Rose Hogenson <rosehogenson@posteo.net> | 2025-11-24 16:18:03 -0800 |
| commit | 36acb0052bde87b82fb6c08d3a57680f8bea4e5f (patch) | |
| tree | b3428f0b79f53e0b4fde4a3ffef505ec486e759b /ccl_test.go | |
| parent | c61422f65bf1859da9336d764bb328b1882ec287 (diff) | |
| download | ccl-36acb0052bde87b82fb6c08d3a57680f8bea4e5f.tar.zst | |
Only allow "true" and "false" for bool
Diffstat (limited to 'ccl_test.go')
| -rw-r--r-- | ccl_test.go | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/ccl_test.go b/ccl_test.go index 15d75af..e377306 100644 --- a/ccl_test.go +++ b/ccl_test.go @@ -270,8 +270,8 @@ can just span multiple lines"`, }, { desc: "Repeated", msg: ` - repeated: 1 - repeated: 2`, + repeated: 1 + repeated: 2`, want: message{Repeated: []int64{1, 2}}, }, { desc: "RepeatedList", @@ -288,9 +288,9 @@ can just span multiple lines"`, }, { desc: "RepeatedListTrailingComma", msg: `repeated: [ - 1, - 2, - ]`, + 1, + 2, + ]`, want: message{Repeated: []int64{1, 2}}, }, { desc: "ListOfMessage", @@ -530,11 +530,11 @@ func TestUnmarshal_InvalidType(t *testing.T) { out: new(struct{ Field struct{ Field int64 } }), }, { desc: "True", - msg: `F:on`, + msg: `F:true`, out: new(struct{ F string }), }, { desc: "False", - msg: `F:no`, + msg: `F:false`, out: new(struct{ F string }), }, { desc: "List", @@ -542,7 +542,7 @@ func TestUnmarshal_InvalidType(t *testing.T) { out: new(struct{ F int64 }), }, { desc: "RepeatedBool", - msg: `F:on F:no`, + msg: `F:true F:false`, out: new(struct{ F []string }), }, { desc: "String", @@ -591,25 +591,25 @@ func TestUnmarshal_InvalidType(t *testing.T) { out: new(struct{ F int }), }, { desc: "IntTrue", - msg: `int:on`, + msg: `int:true`, out: new(struct { F int `ccl:"int"` }), }, { desc: "IntFalse", - msg: `int:no`, + msg: `int:false`, out: new(struct { F int `ccl:"int"` }), }, { desc: "UintTrue", - msg: `uint:on`, + msg: `uint:true`, out: new(struct { F uint `ccl:"uint"` }), }, { desc: "UintFalse", - msg: `uint:no`, + msg: `uint:false`, out: new(struct { F uint `ccl:"uint"` }), @@ -662,8 +662,8 @@ func ExampleUnmarshal() { location { path: "/.well-known/acme-challenge/" root: "/var/lib/acme/acme-challenge" - auth_basic: off - auth_request: off + auth_basic: false + auth_request: false } } `) |
