File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
SampleProjects/TestSomething/test Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -69,4 +69,16 @@ unittest(stream_parse)
6969
7070}
7171
72+ unittest (readStringUntil) {
73+ String data = " " ;
74+ unsigned long micros = 100 ;
75+ data = " abc:def" ;
76+
77+ Stream s;
78+ s.mGodmodeDataIn = &data;
79+ s.mGodmodeMicrosDelay = µs;
80+ // result should not include delimiter
81+ assertEqual (" abc" , s.readStringUntil (' :' ));
82+ assertEqual (" def" , s.readStringUntil (' :' ));
83+ }
7284unittest_main ()
Original file line number Diff line number Diff line change @@ -186,7 +186,7 @@ class Stream : public Print
186186 ret = String (*mGodmodeDataIn );
187187 mGodmodeDataIn ->clear ();
188188 } else {
189- ret = mGodmodeDataIn ->substring (0 , idxTrm + 1 );
189+ ret = mGodmodeDataIn ->substring (0 , idxTrm);
190190 fastforward (idxTrm + 1 );
191191 }
192192 return ret;
You can’t perform that action at this time.
0 commit comments