xo-tokenizer: example tokenrepl restored to wokring order

Now with CBufferedInput in Tokenizer
This commit is contained in:
Roland Conybeare 2026-01-11 19:10:42 -05:00
commit 94e02f0eeb
4 changed files with 27 additions and 18 deletions

View file

@ -34,18 +34,16 @@ namespace xo {
REQUIRE(buf.occupied_range().size() == 0);
REQUIRE(buf.input_range().size() == 0);
std::string_view s0 = "abcdefghijk";
auto s0 = DCircularBuffer::const_span_type::from_cstr("abcdefghijk");
/* return value is unaccepted suffix of input */
REQUIRE(buf.append(DCircularBuffer::span_type((byte *)s0.begin(),
(byte *)s0.end())).empty());
REQUIRE(buf.append(s0).empty());
REQUIRE(buf.verify_ok(verify_policy::log_only()));
REQUIRE(buf.mapped_range().size() == getpagesize());
REQUIRE(buf.occupied_range().size() == s0.size());
REQUIRE(buf.input_range().size() == s0.size());
std::string_view s1 = "lmnopq";
REQUIRE(buf.append(DCircularBuffer::span_type((byte *)s1.begin(),
(byte *)s1.end())).empty());
auto s1 = DCircularBuffer::const_span_type::from_cstr("lmnopq");
REQUIRE(buf.append(s1).empty());
REQUIRE(buf.mapped_range().size() == getpagesize());
REQUIRE(buf.occupied_range().size() == s0.size() + s1.size());