mirror of
https://github.com/miniflux/v2.git
synced 2025-08-06 17:41:00 +00:00
test(readability): add test case for ExtractContent
with broken reader
This commit is contained in:
parent
8a98926674
commit
8c3f280f32
2 changed files with 15 additions and 2 deletions
|
@ -2479,3 +2479,16 @@ func TestCandidateStringEdgeCases(t *testing.T) {
|
|||
}
|
||||
})
|
||||
}
|
||||
|
||||
func TestExtractContentWithBrokenReader(t *testing.T) {
|
||||
if _, _, err := ExtractContent(&brokenReader{}); err == nil {
|
||||
t.Error("Expected ExtractContent to return an error with broken reader")
|
||||
}
|
||||
}
|
||||
|
||||
// brokenReader implements io.Reader but always returns an error
|
||||
type brokenReader struct{}
|
||||
|
||||
func (br *brokenReader) Read(p []byte) (n int, err error) {
|
||||
return 0, fmt.Errorf("simulated read error")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue