summaryrefslogtreecommitdiff
path: root/fpdf_test.go
diff options
context:
space:
mode:
authorKurt <kurt.w.jung@gmail.com>2018-09-19 15:51:34 -0400
committerKurt <kurt.w.jung@gmail.com>2018-09-19 15:51:34 -0400
commit6421d61dcdc4da19badab16dc2a8af331c4fbbeb (patch)
treed0676e7ed421cd20c9ddfb56e83cc1b3985a16b1 /fpdf_test.go
parent7d57599b9d9c5fb48ea733596cbb812d7f84a8d6 (diff)
Add beginning of test to study issue 193
Diffstat (limited to 'fpdf_test.go')
-rw-r--r--fpdf_test.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/fpdf_test.go b/fpdf_test.go
index e82217a..4774ec6 100644
--- a/fpdf_test.go
+++ b/fpdf_test.go
@@ -78,6 +78,28 @@ func TestIssue0116(t *testing.T) {
}
}
+// TestIssue0193 addresses issue 193 in which the error io.EOF is incorrectly
+// assigned to the FPDF instance error.
+func TestIssue0193(t *testing.T) {
+ var png []byte
+ var pdf *gofpdf.Fpdf
+ var err error
+ var rdr *bytes.Reader
+
+ png, err = ioutil.ReadFile(example.ImageFile("sweden.png"))
+ if err == nil {
+ rdr = bytes.NewReader(png)
+ pdf = gofpdf.New("P", "mm", "A4", "")
+ pdf.AddPage()
+ _ = pdf.RegisterImageOptionsReader("sweden", gofpdf.ImageOptions{ImageType: "png", ReadDpi: true}, rdr)
+ err = pdf.Error()
+ }
+ if err != nil {
+ t.Fatalf("issue 193 error: %s", err)
+ }
+
+}
+
// Test to make sure the footer is not call twice and SetFooterFuncLpi can work
// without SetFooterFunc.
func TestFooterFuncLpi(t *testing.T) {