From 25ae030e1a61e4a1e473df11558fdf6908a91351 Mon Sep 17 00:00:00 2001 From: Protryon Date: Tue, 30 Mar 2021 16:24:11 -0700 Subject: [PATCH] fix tokenizer test --- parser/src/tokenizer/mod.rs | 3 ++- parser/src/tokenizer/token.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/parser/src/tokenizer/mod.rs b/parser/src/tokenizer/mod.rs index b82a908772..9637eabbdb 100644 --- a/parser/src/tokenizer/mod.rs +++ b/parser/src/tokenizer/mod.rs @@ -228,7 +228,8 @@ mod tests { // & &= | |= ^ ^= ~ << <<= >> >>= >>> >>>= % %= ||= &&= assert_eq!( output, - r#""test" "test{}test" "test{}" "{}test" "test{" "test}" "test{test" "test}test" "te{{}}" aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8 test_ident 12345 address as bool circuit const else false field for function group i128 i64 i32 i16 i8 if import in input let mut return static string test true u128 u64 u32 u16 u8 self Self console ! != && ( ) * ** **= *= + += , - -= -> _ . .. ... / /= : :: ; < <= = == > >= @ [ ] { { } } || ? // test /* test */ // "# + r#""test" "test{}test" "test{}" "{}test" "test{" "test}" "test{test" "test}test" "te{{}}" aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8 test_ident 12345 address as bool circuit const else false field for function group i128 i64 i32 i16 i8 if import in input let mut return static string test true u128 u64 u32 u16 u8 self Self console ! != && ( ) * ** **= *= + += , - -= -> _ . .. ... / /= : :: ; < <= = == > >= @ [ ] { { } } || ? // test + /* test */ // "# ); } diff --git a/parser/src/tokenizer/token.rs b/parser/src/tokenizer/token.rs index d0df534594..df774c4a82 100644 --- a/parser/src/tokenizer/token.rs +++ b/parser/src/tokenizer/token.rs @@ -199,7 +199,7 @@ impl fmt::Display for Token { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { use Token::*; match self { - CommentLine(s) => writeln!(f, "{}", s), + CommentLine(s) => write!(f, "{}", s), CommentBlock(s) => write!(f, "{}", s), FormattedString(parts) => { // todo escapes