Add unit tests for datasource.go#55
Conversation
4c0ba87 to
c45d18f
Compare
arortiz-rh
left a comment
There was a problem hiding this comment.
Along with the changes I suggested, I also noticed that there aren't any tests checking for what happens if we try and read a file after a close is completed. This might be good coverage to include.
knecasov
left a comment
There was a problem hiding this comment.
I added my comments. Please, consider the following.
-
Read/Seekwithout callingSetCurrentFilefirst: could be useful as an additional edge case test. -
Error messages mix method names with parentheses and plain method names. I would recommend picking one style and keep it consistent across the file.
5e83c03 to
08bf779
Compare
240ac1f to
feb4693
Compare
rosygmiki
left a comment
There was a problem hiding this comment.
The test file ran successfully, and all reviewer comments have been addressed. LGTM.
feb4693 to
f94b791
Compare
ebdd5cf to
c362393
Compare
knecasov
left a comment
There was a problem hiding this comment.
I would add () to the function names as follows.
Read() %d bytes, want %d
Read() content = %q, want %q
Seek() position = %d, want 5
I would add for after () in the following comments.
Read() for nested file failed: %v
Read() for nested file = %q, want %q
Read() for empty file error = %v, want io.EOF
Read() for empty file returned %d bytes, want 0
c362393 to
5075a8b
Compare
| } | ||
|
|
||
| if n != len(testContent) { | ||
| t.Errorf("Read() %d bytes, want %d", n, len(testContent)) |
There was a problem hiding this comment.
I believe the last thing from my side - could you edit the text as follows, please?
Read() returned %d bytes, want %d
This pr adds unit test coverage for the datasource.go implementation Assisted by: Sonnet 4.5 Fixes: containers#23 Signed-off-by: Meriem Elkoudi <melkoudi@redhat.com>
5075a8b to
f3d6a76
Compare
knecasov
left a comment
There was a problem hiding this comment.
LGTM, thank you very much for incorporating all my notes!
This pr adds unit test coverage for the datasource.go implementation
Fixes: #23
Assisted by: Sonnet 4.5