Skip to content

Commit

Permalink
fix issue 257
Browse files Browse the repository at this point in the history
  • Loading branch information
Herringway authored and dlang-bot committed Sep 19, 2020
1 parent 5171925 commit fb6d30e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion source/dyaml/reader.d
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ final class Reader
///
/// Returns: Bytes starting at current position.
char[] prefixBytes(const size_t length) @safe pure nothrow @nogc
in(length == 0 || bufferOffset_ + length < buffer_.length, "prefixBytes out of bounds")
in(length == 0 || bufferOffset_ + length <= buffer_.length, "prefixBytes out of bounds")
{
return buffer_[bufferOffset_ .. bufferOffset_ + length];
}
Expand Down Expand Up @@ -887,3 +887,12 @@ void test1Byte(R)()
testUTF!Reader();
test1Byte!Reader();
}
//Issue 257 - https://github.com/dlang-community/D-YAML/issues/257
@safe unittest
{
import dyaml.loader : Loader;
auto yaml = "hello ";
auto root = Loader.fromString(yaml).load();

assert(root.isValid);
}

0 comments on commit fb6d30e

Please sign in to comment.