def test_LexBuildStep_read_from_file(): step = LexBuildStep() values = list( step.read_from_file( StringIO( """0001:0001 SYMBOL(print) 0001:0006 LPAREN 0001:0008 STRING(Hello, world!) 0001:0024 RPAREN """ ) ) ) assert_equal( values[0].getType(), PepperLexer.SYMBOL ) assert_equal( values[0].getText(), "print" ) assert_equal( values[0].getLine(), 1 ) assert_equal( values[0].getColumn(), 1 ) assert_equal( values[1].getType(), PepperLexer.LPAREN ) assert_equal( values[1].getLine(), 1 ) assert_equal( values[1].getColumn(), 6 ) assert_equal( values[2].getType(), PepperLexer.STRING ) assert_equal( values[2].getText(), "Hello, world!" ) assert_equal( values[2].getLine(), 1 ) assert_equal( values[2].getColumn(), 8 ) assert_equal( values[3].getType(), PepperLexer.RPAREN ) assert_equal( values[3].getLine(), 1 ) assert_equal( values[3].getColumn(), 24 ) assert_equal( len( values ), 4 )