mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2025-10-17 20:34:05 +08:00
Merge pull request #214 from jsalling/feature/c-strings
Print escapes for C strings
This commit is contained in:
@ -1381,7 +1381,7 @@ void testNotEqualString4(void)
|
||||
void testNotEqualStringLen4(void)
|
||||
{
|
||||
EXPECT_ABORT_BEGIN
|
||||
TEST_ASSERT_EQUAL_STRING_LEN("\r\x16", "bar\n", 4);
|
||||
TEST_ASSERT_EQUAL_STRING_LEN("ba\r\x16", "ba\r\n", 4);
|
||||
VERIFY_FAILS_END
|
||||
}
|
||||
|
||||
@ -2283,6 +2283,14 @@ void testFailureCountIncrementsAndIsReturnedAtEnd(void)
|
||||
TEST_ASSERT_EQUAL(1, failures);
|
||||
}
|
||||
|
||||
void testCstringsEscapeSequence(void)
|
||||
{
|
||||
startPutcharSpy();
|
||||
UnityPrint("\x16\x10");
|
||||
endPutcharSpy();
|
||||
TEST_ASSERT_EQUAL_STRING("\\x16\\x10", getBufferPutcharSpy());
|
||||
}
|
||||
|
||||
#define TEST_ASSERT_EQUAL_PRINT_NUMBERS(expected, actual) { \
|
||||
startPutcharSpy(); UnityPrintNumber((actual)); endPutcharSpy(); \
|
||||
TEST_ASSERT_EQUAL_STRING((expected), getBufferPutcharSpy()); \
|
||||
|
Reference in New Issue
Block a user