From 2ef285e45cf828651f7b40313a900b70c4dd9cba Mon Sep 17 00:00:00 2001 From: Mike Cifelli Date: Mon, 27 Feb 2017 13:37:56 -0500 Subject: [PATCH] Added a few extra unit tests for number prefixes --- test/token/TokenFactoryTester.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/token/TokenFactoryTester.java b/test/token/TokenFactoryTester.java index 15ea8f7..eeb61a6 100644 --- a/test/token/TokenFactoryTester.java +++ b/test/token/TokenFactoryTester.java @@ -54,12 +54,24 @@ public class TokenFactoryTester { assertTrue(createToken(text) instanceof Number); } + @Test + public void testPrefixedNumberCreation() { + String text = "-987"; + assertTrue(createToken(text) instanceof Number); + } + @Test public void testIdentifierCreation() { String text = "identifier"; assertTrue(createToken(text) instanceof Identifier); } + @Test + public void testPrefixedIdentifierCreation() { + String text = "-identifier"; + assertTrue(createToken(text) instanceof Identifier); + } + @Test public void testStringCreation() { String text = "\"string\"";