Skip to content

Add test coverage for IndexAllPartial - #477

Open
magic-peach wants to merge 1 commit into
k0sproject:mainfrom
magic-peach:test/byteslice-indexallpartial-coverage
Open

magic-peach wants to merge 1 commit into
k0sproject:mainfrom
magic-peach:test/byteslice-indexallpartial-coverage

Conversation

@magic-peach

Copy link
Copy Markdown
Contributor

byteslice.IndexAllPartial had zero test coverage. It combines IndexAll and PartialIndex to find both complete and trailing partial matches of a delimiter in a byte slice, which callers use to know how much of a buffer is safe to consume versus how much to keep for the next read. Adds cases for no match, full matches only, a partial match only, and a mix of full and partial matches.

Tested with go test ./byteslice/..., which passes and takes package coverage from 80.8% to 96.2%.

Signed-off-by: Akanksha Trehun <akankshatrehun@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant