From 1b63bc4083fa17eec94637d4fb6575a8a86c8357 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Sun, 10 May 2020 23:42:56 -0400 Subject: [PATCH] Add a test for integer literals. --- src/parser/parser.rs | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/parser/parser.rs b/src/parser/parser.rs index 6f14407..3b8b30c 100644 --- a/src/parser/parser.rs +++ b/src/parser/parser.rs @@ -919,8 +919,6 @@ mod tests { ); } - // TODO: Add test for integer literals - #[test] fn test_quoted_partial() { assert_eq!( @@ -944,6 +942,29 @@ mod tests { ); } + #[test] + fn test_literals() { + assert_eq!( + dust_tag(r#"{>foo a="foo" b=179/}"#), + Ok(( + "", + DustTag::DTPartial(Partial { + name: "foo".to_owned(), + params: vec![ + KVPair { + key: "a", + value: RValue::RVString("foo".to_owned()) + }, + KVPair { + key: "b", + value: RValue::RVPositiveInteger(179) + } + ] + }) + )) + ); + } + #[test] fn test_helper() { assert_eq!(