We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8cf9362 commit 27798eeCopy full SHA for 27798ee
crates/mbe/src/subtree_source.rs
@@ -202,3 +202,24 @@ fn convert_leaf(leaf: &tt::Leaf) -> TtToken {
202
tt::Leaf::Punct(punct) => convert_punct(*punct),
203
}
204
205
+
206
+#[cfg(test)]
207
+mod tests {
208
+ use super::{convert_literal, TtToken};
209
+ use syntax::{SmolStr, SyntaxKind};
210
211
+ #[test]
212
+ fn test_negative_literal() {
213
+ assert_eq!(
214
+ convert_literal(&tt::Literal {
215
+ id: tt::TokenId::unspecified(),
216
+ text: SmolStr::new("-42.0")
217
+ }),
218
+ TtToken {
219
+ kind: SyntaxKind::FLOAT_NUMBER,
220
+ is_joint_to_next: false,
221
222
+ }
223
+ );
224
225
+}
0 commit comments