From fe1b1dd7d9edde081c4c95facc19e801863beaff Mon Sep 17 00:00:00 2001 From: Phil Ellison Date: Sun, 28 Jul 2019 19:52:30 +0100 Subject: More direct failing test --- crates/ra_syntax/src/parsing/lexer.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/crates/ra_syntax/src/parsing/lexer.rs b/crates/ra_syntax/src/parsing/lexer.rs index 2a4343b0a..f75e321c3 100644 --- a/crates/ra_syntax/src/parsing/lexer.rs +++ b/crates/ra_syntax/src/parsing/lexer.rs @@ -145,3 +145,16 @@ pub fn classify_literal(text: &str) -> Option { }; Some(Token { kind, len: TextUnit::from_usize(t.len) }) } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn lex_float_literal() { + assert_eq!( + tokenize("42f64")[0], + Token { kind: FLOAT_NUMBER, len: TextUnit::from_usize(5)} + ); + } +} \ No newline at end of file -- cgit v1.2.3