Skip to content

Commit

Permalink
Change 'var expect' to 'const expect' in unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
balacode committed May 13, 2018
1 parent cef04aa commit df0fdfb
Show file tree
Hide file tree
Showing 22 changed files with 48 additions and 48 deletions.
4 changes: 2 additions & 2 deletions utest/compression.go
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// (c) balarabe@protonmail.com License: MIT
// :v: 2018-05-10 22:50:31 88CEEC [utest/compression.go]
// :v: 2018-05-13 01:54:23 295408 [utest/compression.go]
// -----------------------------------------------------------------------------

package utest
Expand Down Expand Up @@ -38,7 +38,7 @@ func Test_PDF_Compression_(t *testing.T) {
// generate a simple PDF with compression turned on
func() {

var expect = `
const expect = `
%PDF-1.4
1 0 obj <</Type/Catalog/Pages 2 0 R>>
endobj
Expand Down
4 changes: 2 additions & 2 deletions utest/doc_author.go
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// (c) balarabe@protonmail.com License: MIT
// :v: 2018-05-10 22:50:31 5E4AD1 [utest/doc_author.go]
// :v: 2018-05-13 01:54:23 C24658 [utest/doc_author.go]
// -----------------------------------------------------------------------------

package utest
Expand Down Expand Up @@ -52,7 +52,7 @@ func Test_PDF_DocAuthor_(t *testing.T) {
var doc = pdf.NewPDF("A4") // initialized PDF
doc.SetCompression(false).SetDocAuthor("'Author' metadata entry")

var expect = `
const expect = `
%PDF-1.4
1 0 obj <</Type/Catalog/Pages 2 0 R>>
endobj
Expand Down
4 changes: 2 additions & 2 deletions utest/doc_creator.go
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// (c) balarabe@protonmail.com License: MIT
// :v: 2018-05-10 22:50:31 D1E1AB [utest/doc_creator.go]
// :v: 2018-05-13 01:54:23 12C52B [utest/doc_creator.go]
// -----------------------------------------------------------------------------

package utest
Expand Down Expand Up @@ -52,7 +52,7 @@ func Test_PDF_DocCreator_(t *testing.T) {
var doc = pdf.NewPDF("A4") // initialized PDF
doc.SetCompression(false).SetDocCreator("'Creator' metadata entry")

var expect = `
const expect = `
%PDF-1.4
1 0 obj <</Type/Catalog/Pages 2 0 R>>
endobj
Expand Down
4 changes: 2 additions & 2 deletions utest/doc_keywords.go
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// (c) balarabe@protonmail.com License: MIT
// :v: 2018-05-10 22:50:31 7B3089 [utest/doc_keywords.go]
// :v: 2018-05-13 01:54:23 75BE7E [utest/doc_keywords.go]
// -----------------------------------------------------------------------------

package utest
Expand Down Expand Up @@ -52,7 +52,7 @@ func Test_PDF_DocKeywords_(t *testing.T) {
var doc = pdf.NewPDF("A4") // initialized PDF
doc.SetCompression(false).SetDocKeywords("'Keywords' metadata entry")

var expect = `
const expect = `
%PDF-1.4
1 0 obj <</Type/Catalog/Pages 2 0 R>>
endobj
Expand Down
4 changes: 2 additions & 2 deletions utest/doc_subject.go
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// (c) balarabe@protonmail.com License: MIT
// :v: 2018-05-10 22:50:31 498AB3 [utest/doc_subject.go]
// :v: 2018-05-13 01:54:23 53F312 [utest/doc_subject.go]
// -----------------------------------------------------------------------------

package utest
Expand Down Expand Up @@ -51,7 +51,7 @@ func Test_PDF_DocSubject_(t *testing.T) {
var doc = pdf.NewPDF("A4") // initialized PDF
doc.SetCompression(false).SetDocSubject("'Subject' metadata entry")

var expect = `
const expect = `
%PDF-1.4
1 0 obj <</Type/Catalog/Pages 2 0 R>>
endobj
Expand Down
4 changes: 2 additions & 2 deletions utest/doc_title.go
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// (c) balarabe@protonmail.com License: MIT
// :v: 2018-05-10 22:50:31 B8F322 [utest/doc_title.go]
// :v: 2018-05-13 01:54:23 816051 [utest/doc_title.go]
// -----------------------------------------------------------------------------

package utest
Expand Down Expand Up @@ -52,7 +52,7 @@ func Test_PDF_DocTitle_(t *testing.T) {
var doc = pdf.NewPDF("A4")
doc.SetCompression(false).SetDocTitle("'Title' metadata entry")

var expect = `
const expect = `
%PDF-1.4
1 0 obj <</Type/Catalog/Pages 2 0 R>>
endobj
Expand Down
4 changes: 2 additions & 2 deletions utest/draw_box.go
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// (c) balarabe@protonmail.com License: MIT
// :v: 2018-05-10 22:50:31 FE02D6 [utest/draw_box.go]
// :v: 2018-05-13 01:54:23 0E0913 [utest/draw_box.go]
// -----------------------------------------------------------------------------

package utest
Expand Down Expand Up @@ -31,7 +31,7 @@ func Test_PDF_DrawBox_(t *testing.T) {
SetColor("DarkGreen").DrawBox(x, y, 9, 9).
SetColor("Blue").DrawBox(x, y, 16, 16)

var expect = `
const expect = `
%PDF-1.4
1 0 obj <</Type/Catalog/Pages 2 0 R>>
endobj
Expand Down
4 changes: 2 additions & 2 deletions utest/draw_circle.go
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// (c) balarabe@protonmail.com License: MIT
// :v: 2018-05-10 22:50:31 09CBB2 [utest/draw_circle.go]
// :v: 2018-05-13 01:54:23 65D14F [utest/draw_circle.go]
// -----------------------------------------------------------------------------

package utest
Expand Down Expand Up @@ -31,7 +31,7 @@ func Test_PDF_DrawCircle_(t *testing.T) {
SetColor("DarkGreen").DrawCircle(x, y, 4.5).
SetColor("Blue").DrawCircle(x, y, 8.5)

var expect = `
const expect = `
%PDF-1.4
1 0 obj <</Type/Catalog/Pages 2 0 R>>
endobj
Expand Down
6 changes: 3 additions & 3 deletions utest/draw_image.go
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// (c) balarabe@protonmail.com License: MIT
// :v: 2018-05-12 02:53:28 EC5A0C [utest/draw_image.go]
// :v: 2018-05-13 01:54:23 CECCAA [utest/draw_image.go]
// -----------------------------------------------------------------------------

package utest
Expand Down Expand Up @@ -62,7 +62,7 @@ func Test_PDF_DrawImage_(t *testing.T) {
}
)

var expectOpaque = `
const expectOpaque = `
%PDF-1.4
1 0 obj <</Type/Catalog/Pages 2 0 R>>
endobj
Expand Down Expand Up @@ -130,7 +130,7 @@ func Test_PDF_DrawImage_(t *testing.T) {
var y = 5.0
var height = 5.0

var expectTransparent = `
const expectTransparent = `
%PDF-1.4
1 0 obj <</Type/Catalog/Pages 2 0 R>>
endobj
Expand Down
6 changes: 3 additions & 3 deletions utest/draw_text.go
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// (c) balarabe@protonmail.com License: MIT
// :v: 2018-05-10 22:50:31 8FFC62 [utest/draw_text.go]
// :v: 2018-05-13 01:54:23 046F0A [utest/draw_text.go]
// -----------------------------------------------------------------------------

package utest
Expand Down Expand Up @@ -30,7 +30,7 @@ func Test_PDF_DrawText_(t *testing.T) {
DrawText("SECOND").
DrawText("THIRD")

var expect = `
const expect = `
%PDF-1.4
1 0 obj <</Type/Catalog/Pages 2 0 R>>
endobj
Expand Down Expand Up @@ -79,7 +79,7 @@ func Test_PDF_DrawText_(t *testing.T) {
SetHorizontalScaling(150).
DrawText("Ye-Olde-Scriptte")

var expect = `
const expect = `
%PDF-1.4
1 0 obj <</Type/Catalog/Pages 2 0 R>>
endobj
Expand Down
4 changes: 2 additions & 2 deletions utest/draw_text_at.go
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// (c) balarabe@protonmail.com License: MIT
// :v: 2018-05-10 22:50:31 16DA26 [utest/draw_text_at.go]
// :v: 2018-05-13 01:54:23 F16B5B [utest/draw_text_at.go]
// -----------------------------------------------------------------------------

package utest
Expand Down Expand Up @@ -33,7 +33,7 @@ func Test_PDF_DrawTextAt_(t *testing.T) {
FillBox(10, 10, 0.1, 0.1).
FillBox(15, 15, 0.1, 0.1)

var expect = `
const expect = `
%PDF-1.4
1 0 obj <</Type/Catalog/Pages 2 0 R>>
endobj
Expand Down
6 changes: 3 additions & 3 deletions utest/draw_text_in_box.go
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// (c) balarabe@protonmail.com License: MIT
// :v: 2018-05-10 22:50:31 129E64 [utest/draw_text_in_box.go]
// :v: 2018-05-13 01:54:23 38AFF8 [utest/draw_text_in_box.go]
// -----------------------------------------------------------------------------

package utest
Expand Down Expand Up @@ -41,7 +41,7 @@ func Test_PDF_DrawTextInBox_(t *testing.T) {
DrawTextInBox(5, 5, 3, 15, "C", ""). // no effect
DrawTextInBox(5, 5, 3, 15, "C", lorem)

var expect = `
const expect = `
%PDF-1.4
1 0 obj <</Type/Catalog/Pages 2 0 R>>
endobj
Expand Down Expand Up @@ -122,7 +122,7 @@ func Test_PDF_DrawTextInBox_(t *testing.T) {
DrawTextInBox(5, 5, 3, 15, "C", ""). // no effect
DrawTextInBox(5, 5, 3, 15, "C", lorem)

var expect = `
const expect = `
%PDF-1.4
1 0 obj <</Type/Catalog/Pages 2 0 R>>
endobj
Expand Down
4 changes: 2 additions & 2 deletions utest/fill_box.go
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// (c) balarabe@protonmail.com License: MIT
// :v: 2018-05-10 22:50:31 558DCD [utest/fill_box.go]
// :v: 2018-05-13 01:54:23 EE968B [utest/fill_box.go]
// -----------------------------------------------------------------------------

package utest
Expand Down Expand Up @@ -30,7 +30,7 @@ func Test_PDF_FillBox_(t *testing.T) {
SetColor("#1B1B1B EerieBlack").
FillBox(x, y, width, height)

var expect = `
const expect = `
%PDF-1.4
1 0 obj <</Type/Catalog/Pages 2 0 R>>
endobj
Expand Down
4 changes: 2 additions & 2 deletions utest/fill_circle.go
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// (c) balarabe@protonmail.com License: MIT
// :v: 2018-05-10 22:50:31 B718DE [utest/fill_circle.go]
// :v: 2018-05-13 01:54:23 930E8D [utest/fill_circle.go]
// -----------------------------------------------------------------------------

package utest
Expand Down Expand Up @@ -28,7 +28,7 @@ func Test_PDF_FillCircle_(t *testing.T) {
SetColor("#BC002D (close to #BE0032 CrimsonGlory)").
FillCircle(x, y, radius)

var expect = `
const expect = `
%PDF-1.4
1 0 obj <</Type/Catalog/Pages 2 0 R>>
endobj
Expand Down
4 changes: 2 additions & 2 deletions utest/font_name.go
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// (c) balarabe@protonmail.com License: MIT
// :v: 2018-05-10 22:50:31 FE32D9 [utest/font_name.go]
// :v: 2018-05-13 01:54:23 00DFA4 [utest/font_name.go]
// -----------------------------------------------------------------------------

package utest
Expand Down Expand Up @@ -57,7 +57,7 @@ func Test_PDF_FontName_(t *testing.T) {
SetFontName("TimesRoman").
DrawText("Hello World!")

var expect = `
const expect = `
%PDF-1.4
1 0 obj <</Type/Catalog/Pages 2 0 R>>
endobj
Expand Down
4 changes: 2 additions & 2 deletions utest/horizontal_scaling.go
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// (c) balarabe@protonmail.com License: MIT
// :v: 2018-05-10 22:50:31 559967 [utest/horizontal_scaling.go]
// :v: 2018-05-13 01:54:23 935F4E [utest/horizontal_scaling.go]
// -----------------------------------------------------------------------------

package utest
Expand Down Expand Up @@ -61,7 +61,7 @@ func Test_PDF_HorizontalScaling_(t *testing.T) {
DrawText("Five hexing wizard bots jump quickly")
}

var expect = `
const expect = `
%PDF-1.4
1 0 obj <</Type/Catalog/Pages 2 0 R>>
endobj
Expand Down
4 changes: 2 additions & 2 deletions utest/line_width.go
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// (c) balarabe@protonmail.com License: MIT
// :v: 2018-05-10 22:50:31 47930D [utest/line_width.go]
// :v: 2018-05-13 01:54:23 8C04BD [utest/line_width.go]
// -----------------------------------------------------------------------------

package utest
Expand Down Expand Up @@ -61,7 +61,7 @@ func Test_PDF_LineWidth_(t *testing.T) {
SetColor("Indigo").SetLineWidth(w).DrawLine(4, y, 15, y)
y += 1
}
var expect = `
const expect = `
%PDF-1.4
1 0 obj <</Type/Catalog/Pages 2 0 R>>
endobj
Expand Down
4 changes: 2 additions & 2 deletions utest/new_pdf.go
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// (c) balarabe@protonmail.com License: MIT
// :v: 2018-05-10 22:50:31 9D0E58 [utest/new_pdf.go]
// :v: 2018-05-13 01:54:23 B03BB1 [utest/new_pdf.go]
// -----------------------------------------------------------------------------

package utest
Expand All @@ -16,7 +16,7 @@ import (
func Test_NewPDF_(t *testing.T) {
fmt.Println("Test NewPDF()")

var expect = `
const expect = `
%PDF-1.4
1 0 obj <</Type/Catalog/Pages 2 0 R>>
endobj
Expand Down
6 changes: 3 additions & 3 deletions utest/reset.go
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// (c) balarabe@protonmail.com License: MIT
// :v: 2018-05-10 22:50:31 DD8066 [utest/reset.go]
// :v: 2018-05-13 01:54:23 0D1A92 [utest/reset.go]
// -----------------------------------------------------------------------------

package utest
Expand Down Expand Up @@ -29,7 +29,7 @@ func Test_PDF_Reset_(t *testing.T) {
DrawText("FIRST").
DrawText("SECOND").
DrawText("THIRD")
var expect = `
const expect = `
%PDF-1.4
1 0 obj <</Type/Catalog/Pages 2 0 R>>
endobj
Expand Down Expand Up @@ -72,7 +72,7 @@ func Test_PDF_Reset_(t *testing.T) {
doc.Reset()
//
// after calling Reset(), the PDF should just be a blank page:
var expect = `
const expect = `
%PDF-1.4
1 0 obj <</Type/Catalog/Pages 2 0 R>>
endobj
Expand Down
4 changes: 2 additions & 2 deletions utest/set_font.go
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// (c) balarabe@protonmail.com License: MIT
// :v: 2018-05-10 22:50:31 9315A6 [utest/set_font.go]
// :v: 2018-05-13 01:54:23 03EA1C [utest/set_font.go]
// -----------------------------------------------------------------------------

package utest
Expand Down Expand Up @@ -69,7 +69,7 @@ func Test_PDF_SetFont_(t *testing.T) {

}

var expect = `
const expect = `
%PDF-1.4
1 0 obj <</Type/Catalog/Pages 2 0 R>>
endobj
Expand Down
4 changes: 2 additions & 2 deletions utest/x.go
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// (c) balarabe@protonmail.com License: MIT
// :v: 2018-05-10 22:50:31 F77190 [utest/x.go]
// :v: 2018-05-13 01:54:23 8C8D77 [utest/x.go]
// -----------------------------------------------------------------------------

package utest
Expand Down Expand Up @@ -45,7 +45,7 @@ func Test_PDF_X_(t *testing.T) {
SetXY(10, 1).
SetFont("Times-Bold", 20).
DrawText("X=10 Y=1")
var expect = `
const expect = `
%PDF-1.4
1 0 obj <</Type/Catalog/Pages 2 0 R>>
endobj
Expand Down

0 comments on commit df0fdfb

Please sign in to comment.