Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wrong offset in large logs when some are skipped. #190

Merged
merged 1 commit into from
Sep 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ private ConsoleLogParser.Result parseFromStart(InputStream inputStream, long pos

private ConsoleLogParser.Result parseFromFinish(InputStream inputStream) throws IOException {
ConsoleLogParser.Result result = new ConsoleLogParser.Result();
result.lineNumber = -1;

int value = inputStream.read();
result.atNewLine = isNewLine(value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public void testSeekWithinLineNegative_isBuilding() throws Exception {
public void testSeekWithinLineNegative_notBuilding() throws Exception {
assumeThat(isBuilding, is(false));
ConsoleLogParser.Result result = new ConsoleLogParser.Result();
result.lineNumber = -5;
result.lineNumber = -4;
assertThat(seek(1 - logLength), is(result));
}

Expand All @@ -167,7 +167,7 @@ public void testSeekNextLineNegative_isBuilding() throws Exception {
public void testSeekNextLineNegative_notBuilding() throws Exception {
assumeThat(isBuilding, is(false));
ConsoleLogParser.Result result = new ConsoleLogParser.Result();
result.lineNumber = -4;
result.lineNumber = -3;
result.atNewLine = true;
assertThat(seek(2 - logLength), is(result));
}
Expand Down