mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
cgen: json sumtype inlining (#11961)
This commit is contained in:
parent
430677a0c0
commit
c75271fcb7
3 changed files with 178 additions and 29 deletions
|
@ -65,7 +65,7 @@ fn test_encode_decode_sumtype() ? {
|
|||
other: [
|
||||
Entity(Item{'Pen'}),
|
||||
Item{'Cookie'},
|
||||
Animal.dog,
|
||||
Animal.cat,
|
||||
'Stool',
|
||||
time.now(),
|
||||
]
|
||||
|
@ -81,6 +81,7 @@ fn test_encode_decode_sumtype() ? {
|
|||
|
||||
assert game.title == dec.title
|
||||
assert game.player == dec.player
|
||||
assert (game.other[2] as Animal) == (dec.other[2] as Animal)
|
||||
assert (game.other[4] as time.Time).unix_time() == (dec.other[4] as time.Time).unix_time()
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue