mirror of
https://github.com/unidoc/unipdf.git
synced 2025-05-02 22:17:06 +08:00
Merge pull request #432 from gunnsth/v3-fix-build
Make e2e split test version independent
This commit is contained in:
commit
3d7ec12ac2
@ -30,15 +30,15 @@ var (
|
|||||||
// knownHashes defines a list of known output hashes to ensure that the output is constant.
|
// knownHashes defines a list of known output hashes to ensure that the output is constant.
|
||||||
// If there is a change in hash need to find out why and update only if the change is accepted.
|
// If there is a change in hash need to find out why and update only if the change is accepted.
|
||||||
var knownHashes = map[string]string{
|
var knownHashes = map[string]string{
|
||||||
"bf7c9d5dabc7e7ec2fc0cf9db2d9c8e7aa456fca.pdf": "0858340ec31e869d7e65a67f5e7b97f5",
|
"bf7c9d5dabc7e7ec2fc0cf9db2d9c8e7aa456fca.pdf": "f7891d491fa9f20ed2975dd28961c205",
|
||||||
"371dce2c2720581a3eef3f123e5741dd3566ef87.pdf": "2343e102e15c5a4ac6ea8e95dab032cc",
|
"371dce2c2720581a3eef3f123e5741dd3566ef87.pdf": "4a25934226b6b64e5d95d571260b1f01",
|
||||||
"e815311526b50036db6e89c54af2b9626edecf30.pdf": "b3843bf3f9df85040df075646e5ffc13",
|
"e815311526b50036db6e89c54af2b9626edecf30.pdf": "97dcfdde59a2f3a6eb105d0c31ebd3fb",
|
||||||
"3bf64014e0c9e4a56f1a9363f1b34fd707bd9fa0.pdf": "3ad89699968b30a31c00a0480ebd9b73",
|
"3bf64014e0c9e4a56f1a9363f1b34fd707bd9fa0.pdf": "6f310c9fdd44d49766d3cc32d3053b89",
|
||||||
"004feecd47e2da4f2ed5cdbbf4791a77dd59ce20.pdf": "74137fe68bfce5135af4ff55dbd471f1",
|
"004feecd47e2da4f2ed5cdbbf4791a77dd59ce20.pdf": "309a072a97d0566aa3f85edae504bb53",
|
||||||
"30c0a5cff80870cd58c2738d622f5d63e37dc90c.pdf": "d1a25c9f5dd1cfc2b665eb4999a1135c",
|
"30c0a5cff80870cd58c2738d622f5d63e37dc90c.pdf": "67d7c2fbf21dd9d65c8bb9ab29dfec60",
|
||||||
"8f8ce400b9d66656cd09260035aa0cc3f7e46c82.pdf": "c94cd56024c724b370ecc61fb67b0fa5",
|
"8f8ce400b9d66656cd09260035aa0cc3f7e46c82.pdf": "679650c27697a7b83ee792692daaff18",
|
||||||
"a35d386af4828b7221591343761191e8f9a28bc0.pdf": "c8858dffbfc091fbb4e32b26bfb33bde",
|
"a35d386af4828b7221591343761191e8f9a28bc0.pdf": "1955d6cf29715652bea999bcbadc818b",
|
||||||
"e815699a5234540fda89ea3a2ece055349a0d535.pdf": "024763e941869dd195438277fa187c30",
|
"e815699a5234540fda89ea3a2ece055349a0d535.pdf": "5a1d97ee1aabc5dcacbbf3cd164b964d",
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestSplitting(t *testing.T) {
|
func TestSplitting(t *testing.T) {
|
||||||
@ -126,6 +126,7 @@ func splitSinglePdf(t *testing.T, params splitParams) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
model.SetPdfProducer("UniDoc")
|
||||||
writer := model.NewPdfWriter()
|
writer := model.NewPdfWriter()
|
||||||
|
|
||||||
// Split the first page.
|
// Split the first page.
|
||||||
|
@ -13,6 +13,7 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"errors"
|
"errors"
|
||||||
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"strings"
|
"strings"
|
||||||
@ -96,7 +97,7 @@ func SetPdfModifiedDate(modifiedDate time.Time) {
|
|||||||
|
|
||||||
func getPdfProducer() string {
|
func getPdfProducer() string {
|
||||||
licenseKey := license.GetLicenseKey()
|
licenseKey := license.GetLicenseKey()
|
||||||
if len(pdfProducer) > 0 && licenseKey.IsLicensed() {
|
if len(pdfProducer) > 0 && (licenseKey.IsLicensed() || flag.Lookup("test.v") != nil) {
|
||||||
return pdfProducer
|
return pdfProducer
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -192,19 +193,12 @@ func NewPdfWriter() PdfWriter {
|
|||||||
key core.PdfObjectName
|
key core.PdfObjectName
|
||||||
value string
|
value string
|
||||||
}{
|
}{
|
||||||
{
|
{"Producer", getPdfProducer()},
|
||||||
"Producer", getPdfProducer(),
|
{"Creator", getPdfCreator()},
|
||||||
}, {
|
{"Author", getPdfAuthor()},
|
||||||
"Creator", getPdfCreator(),
|
{"Subject", getPdfSubject()},
|
||||||
}, {
|
{"Title", getPdfTitle()},
|
||||||
"Author", getPdfAuthor(),
|
{"Keywords", getPdfKeywords()},
|
||||||
}, {
|
|
||||||
"Subject", getPdfSubject(),
|
|
||||||
}, {
|
|
||||||
"Title", getPdfTitle(),
|
|
||||||
}, {
|
|
||||||
"Keywords", getPdfKeywords(),
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
for _, tuple := range metadata {
|
for _, tuple := range metadata {
|
||||||
if tuple.value != "" {
|
if tuple.value != "" {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user