Skip to content

Commit 09d4c4c

Browse files
committed
Adding test code for 'isWhitespace'
1 parent c616c58 commit 09d4c4c

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

test/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ set(TEST_SRCS
3434
src/WCharacter/test_isPunct.cpp
3535
src/WCharacter/test_isSpace.cpp
3636
src/WCharacter/test_isUpperCase.cpp
37+
src/WCharacter/test_isWhitespace.cpp
3738
)
3839

3940
set(TEST_DUT_SRCS
+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright (c) 2020 Arduino. All rights reserved.
3+
*/
4+
5+
/**************************************************************************************
6+
* INCLUDE
7+
**************************************************************************************/
8+
9+
#include <catch.hpp>
10+
11+
#include <WCharacter.h>
12+
13+
/**************************************************************************************
14+
* TEST CODE
15+
**************************************************************************************/
16+
17+
TEST_CASE ("isWhitespace(...) is called with ' '", "[isWhitespace-01]")
18+
{
19+
REQUIRE(arduino::isWhitespace(' ') == true);
20+
}
21+
22+
TEST_CASE ("isWhitespace(...) is called with '\t'", "[isWhitespace-02]")
23+
{
24+
REQUIRE(arduino::isWhitespace('\t') == true);
25+
}
26+
27+
TEST_CASE ("isWhitespace(...) is called with a non whitespace char", "[isWhitespace-03]")
28+
{
29+
REQUIRE(arduino::isWhitespace('\r') == false);
30+
}

0 commit comments

Comments
 (0)