summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Jung <kurt.w.jung@gmail.com>2015-08-27 07:18:13 -0400
committerKurt Jung <kurt.w.jung@gmail.com>2015-08-27 07:18:13 -0400
commit64a844dc1fdc7375b1ec088b1ffd696c02d19e7c (patch)
treeda86e16e0c9b492dcfe426dd53e07c98d0aa1176
parent18c33c52f49afda63dabe7952b0ed98de6aead3a (diff)
Simplified example
-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
}