Handle negative numbers in print
This commit is contained in:
1 parent
662b99a40f
commit
ba0a543a4c
2 files changed
+16
-1
No files matched your search
@@ -50,6 +50,14 @@ static void test_integer_10(void)
|
||||
TEST_ASSERT_EQUAL_MEMORY("10", buffer, 2);
|
||||
}
|
||||
|
||||
static void test_integer_minus_4321(void)
|
||||
{
|
||||
am.val = expr_integer(&am, -4321);
|
||||
const size_t len = print(&am, buffer, BUFFER_SIZE);
|
||||
TEST_ASSERT_EQUAL(5, len);
|
||||
TEST_ASSERT_EQUAL_MEMORY("-4321", buffer, 5);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
UNITY_BEGIN();
|
||||
@@ -57,5 +65,6 @@ int main(void)
|
||||
RUN_TEST(test_integer_1234);
|
||||
RUN_TEST(test_integer_0);
|
||||
RUN_TEST(test_integer_10);
|
||||
RUN_TEST(test_integer_minus_4321);
|
||||
return UNITY_END();
|
||||
}
|
||||
Reference in new issue
Block a user