@@ -719,7 +719,7 @@ pub fn old_find_testable_code(doc: &str, tests: &mut ::test::Collector, position
719719 text : * const hoedown_buffer ,
720720 lang : * const hoedown_buffer ,
721721 data : * const hoedown_renderer_data ,
722- _line : libc:: size_t ) {
722+ line : libc:: size_t ) {
723723 unsafe {
724724 if text. is_null ( ) { return }
725725 let block_info = if lang. is_null ( ) {
@@ -737,22 +737,18 @@ pub fn old_find_testable_code(doc: &str, tests: &mut ::test::Collector, position
737737 let lines = text. lines ( ) . map ( |l| {
738738 stripped_filtered_line ( l) . unwrap_or ( l)
739739 } ) ;
740+ let text = lines. collect :: < Vec < & str > > ( ) . join ( "\n " ) ;
740741 let filename = tests. get_filename ( ) ;
741742
742743 if tests. render_type == RenderType :: Hoedown {
743- let text = ( * text) . as_bytes ( ) ;
744- let text = str:: from_utf8 ( text) . unwrap ( ) ;
745- let lines = text. lines ( ) . map ( |l| {
746- stripped_filtered_line ( l) . unwrap_or ( l)
747- } ) ;
748- let text = lines. collect :: < Vec < & str > > ( ) . join ( "\n " ) ;
744+ let line = tests. get_line ( ) + line;
749745 tests. add_test ( text. to_owned ( ) ,
750746 block_info. should_panic , block_info. no_run ,
751747 block_info. ignore , block_info. test_harness ,
752748 block_info. compile_fail , block_info. error_codes ,
753749 line, filename) ;
754750 } else {
755- tests. add_old_test ( lines . collect :: < Vec < & str > > ( ) . join ( " \n " ) , filename) ;
751+ tests. add_old_test ( text , filename) ;
756752 }
757753 }
758754 }
0 commit comments