Change 33126

tom_tyler (C. Thomas Tyler)
C. Thomas Tyler committed this change into //p4lf/dev/internal
Request Review
Download .zip
Add regression tests for tailer and logger packages

tailer_test.go (6 tests):
- ReadFromStart: verifies all existing content returned on first run
- ReadFromEnd: verifies existing content skipped, only appended bytes returned
- StateResume: save state, new tailer picks up exactly where previous left off
- RotationDetected: inode change triggers reset to offset 0 on new file
- NoNewData: empty file returns nil chunk
- OffsetAccumulation: consecutive flushes produce contiguous offset windows

logger_test.go (6 tests):
- InfoWritten: Infof produces [INFO] line
- WarnAndErrorWritten: WARN and ERROR levels appear correctly
- DebugFiltered: Debugf suppressed when debug=0
- DebugEnabled: Debugf appears when debug=1
- TimestampFormat: each line starts with ISO-8601 UTC timestamp
- Rotate: explicit Rotate() creates rotated file, fresh log at original path
- MaxLogSizeRotation: automatic rotation fires when size threshold exceeded

Co-authored-by: Copilot <[email protected]>
  • Files 2
  • Comments 0
0 edited 2 added 0 deleted
logger/logger_test.go#1
Loading...
tailer/tailer_test.go#1
Loading...
Tip: Use n and p to cycle through the changes.