aboutsummaryrefslogtreecommitdiff
path: root/src/internal/zstd/zstd_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/internal/zstd/zstd_test.go')
-rw-r--r--src/internal/zstd/zstd_test.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/internal/zstd/zstd_test.go b/src/internal/zstd/zstd_test.go
index 4ae6f2b398..f2a2e1b585 100644
--- a/src/internal/zstd/zstd_test.go
+++ b/src/internal/zstd/zstd_test.go
@@ -304,6 +304,17 @@ func TestFileSamples(t *testing.T) {
}
}
+func TestReaderBad(t *testing.T) {
+ for i, s := range badStrings {
+ t.Run(fmt.Sprintf("badStrings#%d", i), func(t *testing.T) {
+ _, err := io.Copy(io.Discard, NewReader(strings.NewReader(s)))
+ if err == nil {
+ t.Error("expected error")
+ }
+ })
+ }
+}
+
func BenchmarkLarge(b *testing.B) {
b.StopTimer()
b.ReportAllocs()