Skip to content

std.Io.Reader.takeDelimiterExclusive() return error.StreamTooLong instead of error.EndOfStream #24950

@truly-not-taken

Description

@truly-not-taken

Zig Version

0.15.1

Steps to Reproduce and Observed Behavior

test {
    var reader = std.Io.Reader.fixed("");
    try std.testing.expectError(
        error.EndOfStream,
        reader.takeDelimiterExclusive('\n'),
    );
}

failed: expected error.EndOfStream, found error.StreamTooLong

Expected Behavior

Docs say

Returned slice excludes the delimiter. End-of-stream is treated equivalent to a delimiter, unless it would result in a length 0 return value, in which case error.EndOfStream is returned instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behaviorstandard libraryThis issue involves writing Zig code for the standard library.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions