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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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()
}