diff --git a/CHANGELOG.md b/CHANGELOG.md index 783d05d4..e213d3cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Changed - Topmost installtion instructions now suggest `gem install arduino_ci` instead of using a `Gemfile`. Reasons for using a `Gemfile` are listed and discussed separately further down the README. +- Stream::readStreamUntil() no longer returns delimiter ### Removed - scanning of `library.properties`; this can and should now be performed by the standalone [`arduino-lint` tool](https://arduino.github.io/arduino-lint). diff --git a/SampleProjects/TestSomething/test/stream.cpp b/SampleProjects/TestSomething/test/stream.cpp index 78f0a0fa..dd218d97 100644 --- a/SampleProjects/TestSomething/test/stream.cpp +++ b/SampleProjects/TestSomething/test/stream.cpp @@ -69,4 +69,16 @@ unittest(stream_parse) } +unittest(readStringUntil) { + String data = ""; + unsigned long micros = 100; + data = "abc:def"; + + Stream s; + s.mGodmodeDataIn = &data; + s.mGodmodeMicrosDelay = µs; + // result should not include delimiter + assertEqual("abc", s.readStringUntil(':')); + assertEqual("def", s.readStringUntil(':')); +} unittest_main() diff --git a/cpp/arduino/Stream.h b/cpp/arduino/Stream.h index 9f766cbf..ef572095 100644 --- a/cpp/arduino/Stream.h +++ b/cpp/arduino/Stream.h @@ -186,7 +186,7 @@ class Stream : public Print ret = String(*mGodmodeDataIn); mGodmodeDataIn->clear(); } else { - ret = mGodmodeDataIn->substring(0, idxTrm + 1); + ret = mGodmodeDataIn->substring(0, idxTrm); fastforward(idxTrm + 1); } return ret;