File tree Expand file tree Collapse file tree 3 files changed +38
-1
lines changed Expand file tree Collapse file tree 3 files changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ set(TEST_SRCS
4949 src/Ringbuffer/test_store_char.cpp
5050 src/Stream/test_getTimeout.cpp
5151 src/Stream/test_readString.cpp
52+ src/Stream/test_readStringUntil.cpp
5253 src/Stream/test_setTimeout.cpp
5354 src/String /test_concat.cpp
5455 src/String /test_operators.cpp
Original file line number Diff line number Diff line change 1010
1111#include < MillisFake.h>
1212#include < StreamMock.h>
13- # include < iostream >
13+
1414/* *************************************************************************************
1515 * TEST CODE
1616 **************************************************************************************/
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright (c) 2020 Arduino. All rights reserved.
3+ */
4+
5+ /* *************************************************************************************
6+ * INCLUDE
7+ **************************************************************************************/
8+
9+ #include < catch.hpp>
10+
11+ #include < MillisFake.h>
12+ #include < StreamMock.h>
13+ #include < iostream>
14+ /* *************************************************************************************
15+ * TEST CODE
16+ **************************************************************************************/
17+
18+ TEST_CASE (" Testing 'readStringUntil' with separator available within the stream" , " [Stream-readStringUntil-01]" )
19+ {
20+ StreamMock mock;
21+ mock.setTimeout (10 );
22+ millis_autoOn ();
23+ mock << " This is test! lorem ipsum lalala" ;
24+
25+ REQUIRE (mock.readStringUntil (' !' ) == arduino::String (" This is test" ));
26+ }
27+
28+ TEST_CASE (" Testing 'readStringUntil' with separator not available within the stream" , " [Stream-readStringUntil-02]" )
29+ {
30+ StreamMock mock;
31+ mock.setTimeout (10 );
32+ millis_autoOn ();
33+ mock << " This is test ... lorem ipsum lalala" ;
34+
35+ REQUIRE (mock.readStringUntil (' !' ) == arduino::String (" This is test ... lorem ipsum lalala" ));
36+ }
You can’t perform that action at this time.
0 commit comments