From 64a844dc1fdc7375b1ec088b1ffd696c02d19e7c Mon Sep 17 00:00:00 2001 From: Kurt Jung Date: Thu, 27 Aug 2015 07:18:13 -0400 Subject: Simplified example --- internal/example/example_test.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'internal') 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 } -- cgit v1.2.1-24-ge1ad