Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added fixtures/sample.epub
Binary file not shown.
Binary file modified fixtures/sample.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fixtures/sample.pdf
Binary file not shown.
Binary file modified fixtures/sample.xlsx
Binary file not shown.
39 changes: 39 additions & 0 deletions fixtures/sources.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,42 @@ sample.webm
* License:
CC BY (https://creativecommons.org/licenses/by/3.0)

sample.pdf
==========
* Original filename:
f4506t.pdf
* Source:
https://www.irs.gov/pub/irs-pdf/f4506t.pdf
* Attribution:
IRS form 4506-T (June 2019), US Department of the Treasury

sample.epub
===========
* Original filename:
p1544.epub
* Source:
https://www.irs.gov/pub/ebook/p1544.epub
* Attribution:
IRS publication "Reporting Cash Payments of Over $10,000" (Sep 2014),
US Department of the Treasury

sample.xlsx
===========
* Original filename:
TTR-tables-2019.xlsx
* Source:
https://home.treasury.gov/system/files/226/TTR-tables-2019.xlsx
* Attribution:
"2019 Total Taxable Resource Estimates", US Department of the Treasury

sample.jpg
==========
* Original filename:
697_VPME2279_1.jpg
* Source
https://www.bep.gov/images/697_VPME2279_1.jpg
* Attribution:
"Die proof - Ornamental Alphabet, A to H inclusive"
Bureau of Engraving & Printing image gallery, US Department of the Treasury


16 changes: 16 additions & 0 deletions match_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ func TestMatchFile(t *testing.T) {
{"mov"},
{"wasm"},
{"dwg"},
{"pdf"},
{"epub"},
}

for _, test := range cases {
Expand Down Expand Up @@ -169,6 +171,8 @@ var docxBuffer, _ = ioutil.ReadFile("./fixtures/sample.docx")
var dwgBuffer, _ = ioutil.ReadFile("./fixtures/sample.dwg")
var mkvBuffer, _ = ioutil.ReadFile("./fixtures/sample.mkv")
var webmBuffer, _ = ioutil.ReadFile("./fixtures/sample.webm")
var pdfBuffer, _ = ioutil.ReadFile("./fixtures/sample.pdf")
var epubBuffer, _ = ioutil.ReadFile("./fixtures/sample.epub")

func BenchmarkMatchTar(b *testing.B) {
for n := 0; n < b.N; n++ {
Expand Down Expand Up @@ -235,3 +239,15 @@ func BenchmarkMatchWebm(b *testing.B) {
Match(webmBuffer)
}
}

func BenchmarkMatchPdf(b *testing.B) {
for n := 0; n < b.N; n++ {
Match(pdfBuffer)
}
}

func BenchmarkMatchEpub(b *testing.B) {
for n := 0; n < b.N; n++ {
Match(epubBuffer)
}
}