aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorPhil Ellison <[email protected]>2019-07-28 19:52:30 +0100
committerPhil Ellison <[email protected]>2019-07-28 19:52:30 +0100
commitfe1b1dd7d9edde081c4c95facc19e801863beaff (patch)
treeba2371353dd8a9b20910b67a799682842ccfd983 /crates
parent8e1a14a098b77b1be8888605f852eada029c816a (diff)
More direct failing test
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_syntax/src/parsing/lexer.rs13
1 files changed, 13 insertions, 0 deletions
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<Token> {
145 }; 145 };
146 Some(Token { kind, len: TextUnit::from_usize(t.len) }) 146 Some(Token { kind, len: TextUnit::from_usize(t.len) })
147} 147}
148
149#[cfg(test)]
150mod tests {
151 use super::*;
152
153 #[test]
154 fn lex_float_literal() {
155 assert_eq!(
156 tokenize("42f64")[0],
157 Token { kind: FLOAT_NUMBER, len: TextUnit::from_usize(5)}
158 );
159 }
160} \ No newline at end of file