summaryrefslogtreecommitdiff
path: root/internal/example/example_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/example/example_test.go')
-rw-r--r--internal/example/example_test.go14
1 files changed, 8 insertions, 6 deletions
diff --git a/internal/example/example_test.go b/internal/example/example_test.go
index 54f4689..60ac1ac 100644
--- a/internal/example/example_test.go
+++ b/internal/example/example_test.go
@@ -17,15 +17,17 @@
package example_test
import (
- "fmt"
- "path/filepath"
+ "errors"
"github.com/jung-kurt/gofpdf/internal/example"
)
-// Test the Filename() function.
-func ExampleExample_Filename() {
- fmt.Println(filepath.ToSlash(example.Filename("foo")))
+// Test the Filename() and Summary() functions.
+func Example_Filename() {
+ fileStr := example.Filename("example")
+ example.Summary(nil, fileStr)
+ example.Summary(errors.New("printer on fire"), fileStr)
// Output:
- // ../../pdf/foo.pdf
+ // Successfully generated ../../pdf/example.pdf
+ // printer on fire
}