File tree 3 files changed +38
-1
lines changed
3 files changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ set(TEST_SRCS
49
49
src/Ringbuffer/test_store_char.cpp
50
50
src/Stream/test_getTimeout.cpp
51
51
src/Stream/test_readString.cpp
52
+ src/Stream/test_readStringUntil.cpp
52
53
src/Stream/test_setTimeout.cpp
53
54
src/String /test_concat.cpp
54
55
src/String /test_operators.cpp
Original file line number Diff line number Diff line change 10
10
11
11
#include < MillisFake.h>
12
12
#include < StreamMock.h>
13
- # include < iostream >
13
+
14
14
/* *************************************************************************************
15
15
* TEST CODE
16
16
**************************************************************************************/
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