<s> from topaz import consts <EOL> class TestCompiler ( object ) : <EOL> def assert_compiles ( self , space , source , expected_bytecode_str ) : <EOL> bc = space . compile ( source , None ) <EOL> self . assert_compiled ( bc , expected_bytecode_str ) <EOL> return bc <EOL> def get_lines ( self , bc ) : <EOL> actual = [ ] <EOL> i = <NUM_LIT:0> <EOL> while i < len ( bc . code ) : <EOL> c = ord ( bc . code [ i ] ) <EOL> line = consts . BYTECODE_NAMES [ c ] <EOL> i += <NUM_LIT:1> <EOL> for j in xrange ( consts . BYTECODE_NUM_ARGS [ c ] ) : <EOL> v = ord ( bc . code [ i ] ) | ( ord ( bc . code [ i + <NUM_LIT:1> ] ) * <NUM_LIT> ) <EOL> line += "<STR_LIT>" % v <EOL> i += <NUM_LIT:2> <EOL> actual . append ( line ) <EOL> return actual <EOL> def assert_compiled ( self , bc , expected_bytecode_str ) : <EOL> expected = [ ] <EOL> for line in expected_bytecode_str . splitlines ( ) : <EOL> if "<STR_LIT:#>" in line : <EOL> line = line [ : line . index ( "<STR_LIT:#>" ) ] <EOL> line = line . strip ( ) <EOL> if line : <EOL> expected . append ( line ) <EOL> actual = self . get_lines ( bc ) <EOL> assert actual == expected <EOL> def test_int_constant ( self , space ) : <EOL> bc = self . assert_compiles ( space , "<STR_LIT:1>" , """<STR_LIT>""" ) <EOL> [ c ] = bc . consts_w <EOL> assert space . int_w ( c ) == <NUM_LIT:1> <EOL> assert bc . max_stackdepth == <NUM_LIT:1> <EOL> def test_float_constant ( self , space ) : <EOL> bc = self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> [ c ] = bc . consts_w <EOL> assert space . float_w ( c ) == <NUM_LIT> <EOL> def test_addition ( self , space ) : <EOL> bc = self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> assert bc . max_stackdepth == <NUM_LIT:2> <EOL> assert bc . consts_w [ <NUM_LIT:2> ] . symbol == "<STR_LIT:+>" <EOL> def test_multi_term_expr ( self , space ) : <EOL> self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> def test_multiple_statements ( self , space ) : <EOL> self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> def test_send ( self , space ) : <EOL> self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> def test_assignment ( self , space ) : <EOL> self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> bc = self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> assert bc . cellvars == [ "<STR_LIT:a>" ] <EOL> def test_load_var ( self , space ) : <EOL> bc = self . assert_compiles ( space , "<STR_LIT:a>" , """<STR_LIT>""" ) <EOL> assert bc . cellvars == [ ] <EOL> bc = self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> assert bc . cellvars == [ "<STR_LIT:a>" ] <EOL> def test_if ( self , space ) : <EOL> self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> def test_unless ( self , space ) : <EOL> self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> def test_named_constants ( self , space ) : <EOL> bc = self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> assert bc . consts_w == [ space . w_false , space . w_true , space . w_nil ] <EOL> def test_comparison ( self , space ) : <EOL> self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> def test_while ( self , space ) : <EOL> self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> def test_for_loop ( self , space ) : <EOL> bc = self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> self . assert_compiled ( bc . consts_w [ <NUM_LIT:0> ] , """<STR_LIT>""" ) <EOL> def test_for_loop_over_send_block ( self , space ) : <EOL> self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> def test_until ( self , space ) : <EOL> self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> def test_return ( self , space ) : <EOL> self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> def test_array ( self , space ) : <EOL> bc = self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> assert bc . max_stackdepth == <NUM_LIT:3> <EOL> bc = self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> def test_subscript ( self , space ) : <EOL> self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> def test_def_function ( self , space ) : <EOL> bc = self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> self . assert_compiled ( bc . consts_w [ <NUM_LIT:1> ] , """<STR_LIT>""" ) <EOL> bc = self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> self . assert_compiled ( bc . consts_w [ <NUM_LIT:1> ] , """<STR_LIT>""" ) <EOL> def test_string ( self , space ) : <EOL> self . assert_compiles ( space , '<STR_LIT>' , """<STR_LIT>""" ) <EOL> def test_dynamic_string ( self , space ) : <EOL> self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> def test_dynamic_symbol ( self , space ) : <EOL> self . assert_compiles ( space , '<STR_LIT>' , """<STR_LIT>""" ) <EOL> def test_class ( self , space ) : <EOL> bc = self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> self . assert_compiled ( bc . consts_w [ <NUM_LIT:2> ] , """<STR_LIT>""" ) <EOL> bc = self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> self . assert_compiled ( bc . consts_w [ <NUM_LIT:2> ] , """<STR_LIT>""" ) <EOL> self . assert_compiled ( bc . consts_w [ <NUM_LIT:2> ] . consts_w [ <NUM_LIT:1> ] , """<STR_LIT>""" ) <EOL> self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> def test_singleton_class ( self , space ) : <EOL> self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> def test_constants ( self , space ) : <EOL> self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> def test_self ( self , space ) : <EOL> self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> def test_instance_variable ( self , space ) : <EOL> self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> def test_class_variables ( self , space ) : <EOL> self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> def test_send_block ( self , space ) : <EOL> bc = self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> self . assert_compiled ( bc . consts_w [ <NUM_LIT:3> ] , """<STR_LIT>""" ) <EOL> def test_yield ( self , space ) : <EOL> bc = self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> self . assert_compiled ( bc . consts_w [ <NUM_LIT:1> ] , """<STR_LIT>""" ) <EOL> def test_constant_symbol ( self , space ) : <EOL> bc = self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> [ c ] = bc . consts_w <EOL> assert space . symbol_w ( c ) == "<STR_LIT:abc>" <EOL> def test_range ( self , space ) : <EOL> self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> def test_block_scope ( self , space ) : <EOL> bc = self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> assert bc . max_stackdepth == <NUM_LIT:3> <EOL> self . assert_compiled ( bc . consts_w [ <NUM_LIT:1> ] , """<STR_LIT>""" ) <EOL> bc = self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> self . assert_compiled ( bc . consts_w [ <NUM_LIT:1> ] , """<STR_LIT>""" ) <EOL> def test_multiple_blocks ( self , space ) : <EOL> bc = self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> self . assert_compiled ( bc . consts_w [ <NUM_LIT:1> ] , """<STR_LIT>""" ) <EOL> def test_multiple_blocks_in_block ( self , space ) : <EOL> bc = self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> self . assert_compiled ( bc . consts_w [ <NUM_LIT:0> ] , """<STR_LIT>""" ) <EOL> self . assert_compiled ( bc . consts_w [ <NUM_LIT:0> ] . consts_w [ <NUM_LIT:1> ] , """<STR_LIT>""" ) <EOL> self . assert_compiled ( bc . consts_w [ <NUM_LIT:0> ] . consts_w [ <NUM_LIT:3> ] , """<STR_LIT>""" ) <EOL> def test_method_assignment ( self , space ) : <EOL> bc = self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> assert space . symbol_w ( bc . consts_w [ <NUM_LIT:1> ] ) == "<STR_LIT>" <EOL> def test_parameter_is_cell ( self , space ) : <EOL> bc = self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> self . assert_compiled ( bc . consts_w [ <NUM_LIT:1> ] , """<STR_LIT>""" ) <EOL> self . assert_compiled ( bc . consts_w [ <NUM_LIT:1> ] . consts_w [ <NUM_LIT:0> ] , """<STR_LIT>""" ) <EOL> def test_augmented_assignment ( self , space ) : <EOL> self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> bc = self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> assert space . symbol_w ( bc . consts_w [ <NUM_LIT:0> ] ) == "<STR_LIT:x>" <EOL> assert space . symbol_w ( bc . consts_w [ <NUM_LIT:1> ] ) == "<STR_LIT:y>" <EOL> assert space . symbol_w ( bc . consts_w [ <NUM_LIT:3> ] ) == "<STR_LIT:+>" <EOL> assert space . symbol_w ( bc . consts_w [ <NUM_LIT:4> ] ) == "<STR_LIT>" <EOL> self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> def test_multiple_cells ( self , space ) : <EOL> bc = self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> self . assert_compiled ( bc . consts_w [ <NUM_LIT:3> ] , """<STR_LIT>""" ) <EOL> def test_nested_block ( self , space ) : <EOL> bc = self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> assert bc . freevars == [ ] <EOL> assert bc . cellvars == [ "<STR_LIT>" ] <EOL> self . assert_compiled ( bc . consts_w [ <NUM_LIT:0> ] , """<STR_LIT>""" ) <EOL> assert bc . consts_w [ <NUM_LIT:0> ] . freevars == [ "<STR_LIT>" ] <EOL> assert bc . consts_w [ <NUM_LIT:0> ] . cellvars == [ "<STR_LIT:x>" ] <EOL> self . assert_compiled ( bc . consts_w [ <NUM_LIT:0> ] . consts_w [ <NUM_LIT:0> ] , """<STR_LIT>""" ) <EOL> assert bc . consts_w [ <NUM_LIT:0> ] . consts_w [ <NUM_LIT:0> ] . freevars == [ "<STR_LIT>" , "<STR_LIT:x>" ] <EOL> assert bc . consts_w [ <NUM_LIT:0> ] . consts_w [ <NUM_LIT:0> ] . cellvars == [ "<STR_LIT:y>" ] <EOL> def test_unary_op ( self , space ) : <EOL> bc = self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> [ _ , sym ] = bc . consts_w <EOL> assert space . symbol_w ( sym ) == "<STR_LIT>" <EOL> bc = self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> [ _ , sym ] = bc . consts_w <EOL> assert space . symbol_w ( sym ) == "<STR_LIT>" <EOL> def test_assignment_in_block_closure ( self , space ) : <EOL> bc = self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> self . assert_compiled ( bc . consts_w [ <NUM_LIT:0> ] , """<STR_LIT>""" ) <EOL> self . assert_compiled ( bc . consts_w [ <NUM_LIT:0> ] . consts_w [ <NUM_LIT:1> ] , """<STR_LIT>""" ) <EOL> def test_lookup_constant ( self , space ) : <EOL> self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> bc = self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> assert bc . consts_w [ <NUM_LIT:0> ] is space . w_object <EOL> def test_assign_constant ( self , space ) : <EOL> self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> def test___FILE__ ( self , space ) : <EOL> self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> def test_default_argument ( self , space ) : <EOL> bc = self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> self . assert_compiled ( bc . consts_w [ <NUM_LIT:1> ] , """<STR_LIT>""" ) <EOL> self . assert_compiled ( bc . consts_w [ <NUM_LIT:1> ] . defaults [ <NUM_LIT:0> ] , """<STR_LIT>""" ) <EOL> self . assert_compiled ( bc . consts_w [ <NUM_LIT:1> ] . defaults [ <NUM_LIT:1> ] , """<STR_LIT>""" ) <EOL> def test_exceptions ( self , space ) : <EOL> self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> def test_ensure ( self , space ) : <EOL> bc = self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> assert bc . max_stackdepth == <NUM_LIT:4> <EOL> def test_block_argument ( self , space ) : <EOL> bc = self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> w_code = bc . consts_w [ <NUM_LIT:1> ] <EOL> assert w_code . cellvars == [ "<STR_LIT:a>" , "<STR_LIT:b>" ] <EOL> assert w_code . block_arg_pos == <NUM_LIT:1> <EOL> def test_module ( self , space ) : <EOL> bc = self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> self . assert_compiled ( bc . consts_w [ <NUM_LIT:1> ] , """<STR_LIT>""" ) <EOL> self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> def test_splat_send ( self , space ) : <EOL> self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> def test_block_splat_send ( self , space ) : <EOL> self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> def test_singleton_method ( self , space ) : <EOL> self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> def test_stack_depth_default_arg ( self , space ) : <EOL> bc = self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> assert bc . consts_w [ <NUM_LIT:1> ] . max_stackdepth == <NUM_LIT:2> <EOL> def test_global_variable ( self , space ) : <EOL> self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> def test_send_block_argument ( self , space ) : <EOL> self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> def test_declare_splat_argument ( self , space ) : <EOL> bc = self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> self . assert_compiled ( bc . consts_w [ <NUM_LIT:1> ] , """<STR_LIT>""" ) <EOL> bc = self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> self . assert_compiled ( bc . consts_w [ <NUM_LIT:1> ] , """<STR_LIT>""" ) <EOL> def test_regexp ( self , space ) : <EOL> self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> def test_dynamic_regexp ( self , space ) : <EOL> self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> def test_or ( self , space ) : <EOL> self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> def test_and ( self , space ) : <EOL> self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> def test_not ( self , space ) : <EOL> self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> def test_subscript_assignment ( self , space ) : <EOL> self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> def test_case ( self , space ) : <EOL> self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> def test_hash ( self , space ) : <EOL> self . assert_compiles ( space , "<STR_LIT:{}>" , """<STR_LIT>""" ) <EOL> self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> def test_or_equal ( self , space ) : <EOL> self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> def test_and_equal ( self , space ) : <EOL> self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> def test_block_return ( self , space ) : <EOL> bc = self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) <EOL> self . assert_compiled ( bc . consts_w [ <NUM_LIT:0> ] , """<STR_LIT>""" ) <EOL> def test_multi_assignment ( self , space ) : <EOL> self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> def test_splat_assignment ( self , space ) : <EOL> self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> def test_discard_splat_assignment ( self , space ) : <EOL> self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> def test_alias ( self , space ) : <EOL> bc = self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> [ w_a , w_b , w_alias_method , _ ] = bc . consts_w <EOL> assert space . symbol_w ( w_a ) == "<STR_LIT:a>" <EOL> assert space . symbol_w ( w_b ) == "<STR_LIT:b>" <EOL> assert space . symbol_w ( w_alias_method ) == "<STR_LIT>" <EOL> def test_defined ( self , space ) : <EOL> self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> def test_super ( self , space ) : <EOL> bc = self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> assert bc . consts_w [ <NUM_LIT:0> ] is space . w_nil <EOL> bc = self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> self . assert_compiled ( bc . consts_w [ <NUM_LIT:1> ] , """<STR_LIT>""" ) <EOL> assert space . str_w ( bc . consts_w [ <NUM_LIT:1> ] . consts_w [ <NUM_LIT:0> ] ) == "<STR_LIT:f>" <EOL> bc = self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> bc = self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> self . assert_compiled ( bc . consts_w [ <NUM_LIT:1> ] , """<STR_LIT>""" ) <EOL> def test_next_block ( self , space ) : <EOL> bc = self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> self . assert_compiled ( bc . consts_w [ <NUM_LIT:0> ] , """<STR_LIT>""" ) <EOL> def test_next_loop ( self , space ) : <EOL> self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> def test_break_loop ( self , space ) : <EOL> self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> def test_break_block ( self , space ) : <EOL> bc = self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> self . assert_compiled ( bc . consts_w [ <NUM_LIT:0> ] , """<STR_LIT>""" ) <EOL> def test_undef ( self , space ) : <EOL> self . assert_compiles ( space , """<STR_LIT>""" , """<STR_LIT>""" ) <EOL> def test_lambda ( self , space ) : <EOL> self . assert_compiles ( space , "<STR_LIT>" , """<STR_LIT>""" ) </s>
