<s> from dotviewer . msgstruct import * <EOL> def test_message ( ) : <EOL> yield checkmsg , '<STR_LIT:A>' <EOL> yield checkmsg , '<STR_LIT:B>' , <NUM_LIT> , "<STR_LIT:hello>" , - <NUM_LIT> , - <NUM_LIT> <EOL> yield checkmsg , '<STR_LIT:C>' , "<STR_LIT:x>" * <NUM_LIT> + "<STR_LIT:y>" <EOL> yield checkmsg , '<STR_LIT:D>' , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> <EOL> yield checkmsg , '<STR_LIT:E>' , - <NUM_LIT> , - <NUM_LIT> , - <NUM_LIT> , - <NUM_LIT> <EOL> yield ( checkmsg , '<STR_LIT:F>' , ) + tuple ( range ( <NUM_LIT> ) ) <EOL> def checkmsg ( * args ) : <EOL> encoded = message ( * args ) <EOL> assert decodemessage ( encoded [ : - <NUM_LIT:1> ] ) == ( None , encoded [ : - <NUM_LIT:1> ] ) <EOL> assert decodemessage ( encoded ) == ( args , '<STR_LIT>' ) <EOL> assert decodemessage ( encoded + '<STR_LIT>' ) == ( args , '<STR_LIT>' ) </s>
