forked from arduino/ArduinoCore-API
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_readString.cpp
More file actions
28 lines (22 loc) · 866 Bytes
/
test_readString.cpp
File metadata and controls
28 lines (22 loc) · 866 Bytes
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
/*
* Copyright (c) 2020 Arduino. All rights reserved.
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
/**************************************************************************************
* INCLUDE
**************************************************************************************/
#include <catch2/catch_test_macros.hpp>
#include <MillisFake.h>
#include <StreamMock.h>
/**************************************************************************************
* TEST CODE
**************************************************************************************/
TEST_CASE ("Testing 'readString' with data available within the stream", "[Stream-readString-01]")
{
StreamMock mock;
mock.setTimeout(10);
millis_autoOn();
mock << "This is test stream content";
REQUIRE(mock.readString() == arduino::String("This is test stream content"));
}