File tree Expand file tree Collapse file tree
crates/engine_bibtex/bibtex Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -529,8 +529,16 @@ input_ln(peekable_input_t *peekable)
529529 buffer [last ] = peekable_getc (peekable );
530530 last ++ ;
531531 }
532+
533+ // For side effects - consume the eoln we saw
534+ int eoln = peekable_getc (peekable );
532535
533- peekable_getc (peekable );
536+ // Handle \r\n newlines on Windows by trying to consume a \n after a \r, unget if it's not that exact pair
537+ int next = peekable_getc (peekable );
538+ printf ("Next Char: %d\n" , next );
539+ if (!(eoln == '\r' && next == '\n' )) {
540+ peekable_ungetc (peekable , next );
541+ }
534542
535543 while (last > 0 ) {
536544 if (lex_class [buffer [last - 1 ]] == 1 /*white_space */ )
Original file line number Diff line number Diff line change @@ -22,10 +22,7 @@ struct TestCase {
2222}
2323
2424impl TestCase {
25- fn new (
26- stem : & str ,
27- subdir : Option < & str > ,
28- ) -> Self {
25+ fn new ( stem : & str , subdir : Option < & str > ) -> Self {
2926 TestCase {
3027 stem : stem. to_owned ( ) ,
3128 subdir : subdir. map ( String :: from) ,
@@ -94,9 +91,7 @@ fn single_entry() {
9491
9592#[ test]
9693fn test_empty_files ( ) {
97- TestCase :: new ( "empty" , Some ( "empty" ) )
98- . test_bbl ( false )
99- . go ( )
94+ TestCase :: new ( "empty" , Some ( "empty" ) ) . test_bbl ( false ) . go ( )
10095}
10196
10297#[ test]
Original file line number Diff line number Diff line change @@ -166,8 +166,6 @@ impl ExpectedInfo {
166166 }
167167
168168 pub fn test_data ( & self , observed : & [ u8 ] ) {
169- println ! ( "Expected:\n {:?}" , self . contents) ;
170- println ! ( "Observed:\n {observed:?}" ) ;
171169 if self . contents == observed {
172170 return ;
173171 }
You can’t perform that action at this time.
0 commit comments