summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt <kurt.w.jung@gmail.com>2017-11-12 12:32:52 -0500
committerKurt <kurt.w.jung@gmail.com>2017-11-12 12:32:52 -0500
commit5e5bb8c2a2d6d41c3d0ef93f5d6181e7f1070a33 (patch)
tree1d402d190df4f2fafbabd0f9bf79eb86fad7386c
parent9abfbb92974aff5a2c689299dafb4d020a0afab2 (diff)
Remove default byte-for-byte comparison of generated PDF with reference PDF. This comparison step started as a means of assuring repeatability across platforms, but has been an ongoing source of frustration with ordering of internal dictionaries and resources.
-rw-r--r--internal/example/example.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/internal/example/example.go b/internal/example/example.go
index e828c05..90f861a 100644
--- a/internal/example/example.go
+++ b/internal/example/example.go
@@ -115,6 +115,22 @@ func referenceCompare(fileStr string) (err error) {
// error is not nil, its String() value is printed to standard output.
func Summary(err error, fileStr string) {
if err == nil {
+ fileStr = filepath.ToSlash(fileStr)
+ fmt.Printf("Successfully generated %s\n", fileStr)
+ } else {
+ fmt.Println(err)
+ }
+}
+
+// SummaryCompare generates a predictable report for use by test examples. If
+// the specified error is nil, the generated file is compared with a reference
+// copy for byte-for-byte equality. If the files match, then the filename
+// delimiters are normalized and the filename printed to standard output with a
+// success message. If the files do not match, this condition is reported on
+// standard output. If the specified error is not nil, its String() value is
+// printed to standard output.
+func SummaryCompare(err error, fileStr string) {
+ if err == nil {
err = referenceCompare(fileStr)
}
if err == nil {