diff options
| author | Laytan Laats <laytanlaats@hotmail.com> | 2023-12-23 18:52:53 +0100 |
|---|---|---|
| committer | Laytan Laats <laytanlaats@hotmail.com> | 2024-03-04 17:26:19 +0100 |
| commit | 759d095548e7135bbfeb68ac6b0a21857af49527 (patch) | |
| tree | 8cab087aacb047ac6d5a8c4331e586779da2bc72 /tests/core/encoding | |
| parent | 7854aa22d99b2c0340f4352f133ce06fd1b80df6 (diff) | |
encoding/cbor: ignore struct fields with `cbor:"-"`
Diffstat (limited to 'tests/core/encoding')
| -rw-r--r-- | tests/core/encoding/cbor/test_core_cbor.odin | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/core/encoding/cbor/test_core_cbor.odin b/tests/core/encoding/cbor/test_core_cbor.odin index 0fb8b521f..daf31c277 100644 --- a/tests/core/encoding/cbor/test_core_cbor.odin +++ b/tests/core/encoding/cbor/test_core_cbor.odin @@ -130,6 +130,7 @@ Foo :: struct { small_onetwenty: i128, biggest: big.Int, smallest: big.Int, + ignore_this: ^Foo `cbor:"-"`, } FooBar :: enum { @@ -189,6 +190,7 @@ test_marshalling :: proc(t: ^testing.T) { smallie = cbor.Negative_U64(max(u64)), onetwenty = i128(12345), small_onetwenty = -i128(max(u64)), + ignore_this = &Foo{}, } big.atoi(&f.biggest, "1234567891011121314151617181920") @@ -343,6 +345,7 @@ test_marshalling :: proc(t: ^testing.T) { ev(t, backf.smallie, f.smallie) ev(t, backf.onetwenty, f.onetwenty) ev(t, backf.small_onetwenty, f.small_onetwenty) + ev(t, backf.ignore_this, nil) s_equals, s_err := big.equals(&backf.smallest, &f.smallest) ev(t, s_err, nil) |