1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

cgen: json sumtype inlining (#11961)

This commit is contained in:
Anton Zavodchikov
2021-09-24 18:49:00 +05:00
committed by GitHub
parent 430677a0c0
commit c75271fcb7
3 changed files with 178 additions and 29 deletions

View File

@ -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()
}