-
-
Notifications
You must be signed in to change notification settings - Fork 130
/
Copy pathtest_isSpace.cpp
38 lines (29 loc) · 1.2 KB
/
test_isSpace.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
* Copyright (c) 2020 Arduino. All rights reserved.
*/
/**************************************************************************************
* INCLUDE
**************************************************************************************/
#include <catch.hpp>
#include <vector>
#include <WCharacter.h>
/**************************************************************************************
* CONSTANTS
**************************************************************************************/
std::vector<char> const VALID_SPACE_VECT = {' ', '\t', '\n', '\v', '\f', '\r'};
/**************************************************************************************
* TEST CODE
**************************************************************************************/
TEST_CASE ("isSpace(...) is called with a valid white space character", "[isSpace-01]")
{
std::for_each(std::begin(VALID_SPACE_VECT),
std::end (VALID_SPACE_VECT),
[](char const c)
{
REQUIRE(arduino::isSpace(c) == true);
});
}
TEST_CASE ("isSpace(...) is called with a invalid white space character", "[isSpace-02]")
{
REQUIRE(arduino::isSpace('{') == false);
}