Skip to content

Commit 0cce0f3

Browse files
committed
testdata: use Go generate to produce test files
1 parent dca67e5 commit 0cce0f3

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

testdata/huffman.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
// +build ignore
66

7+
//go:generate go run huffman.go
8+
79
// Generates huffman.txt. This test file heavily favors prefix based encodings
810
// since some symbols are heavily favored over others. This leads to compression
911
// savings that can be gained by assigning shorter prefix codes to those more

testdata/random.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
// +build ignore
66

7+
//go:generate go run random.go
8+
79
// Generates random.bin. This test file contains random data throughout and
810
// tests the worst case compression scenario.
911
package main

testdata/repeats.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
// +build ignore
66

7+
//go:generate go run repeats.go
8+
79
// Generates repeats.bin. This test file heavily favors LZ77 based compression
810
// since a large bulk of its data is a copy from some distance ago. Also, since
911
// the source data is mostly random, prefix encoding does not benefit as much.

testdata/zeros.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
// +build ignore
66

7+
//go:generate go run zeros.go
8+
79
// Generates zeros.bin. This test file contains zeroed data throughout and
810
// tests the best case compression scenario.
911
package main

0 commit comments

Comments
 (0)