summaryrefslogtreecommitdiff
path: root/pkg/btrfs/crc32c_test.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2022-06-15 23:26:54 -0600
committerLuke Shumaker <lukeshu@lukeshu.com>2022-06-15 23:26:54 -0600
commit4b4d3fe609ecb99cf43aa4a70787bfa2113e6018 (patch)
treee8bae60b5a3d717657aa829f3d684715b0334aa7 /pkg/btrfs/crc32c_test.go
parent8565a4c162d23d0032944fc41772e7af41fa6a08 (diff)
dump-tree: Sync up to 5.18.1; implement csum types
Diffstat (limited to 'pkg/btrfs/crc32c_test.go')
-rw-r--r--pkg/btrfs/crc32c_test.go35
1 files changed, 0 insertions, 35 deletions
diff --git a/pkg/btrfs/crc32c_test.go b/pkg/btrfs/crc32c_test.go
deleted file mode 100644
index 335b3cc..0000000
--- a/pkg/btrfs/crc32c_test.go
+++ /dev/null
@@ -1,35 +0,0 @@
-package btrfs_test
-
-import (
- "fmt"
- "testing"
-
- "github.com/stretchr/testify/assert"
-
- "lukeshu.com/btrfs-tools/pkg/btrfs"
-)
-
-func TestCSumFormat(t *testing.T) {
- t.Parallel()
- type TestCase struct {
- InputSum btrfs.CSum
- InputFmt string
- Output string
- }
- csum := btrfs.CSum{0xbd, 0x7b, 0x41, 0xf4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}
- testcases := map[string]TestCase{
- "s": TestCase{InputSum: csum, InputFmt: "%s", Output: "bd7b41f400000000000000000000000000000000000000000000000000000000"},
- "x": TestCase{InputSum: csum, InputFmt: "%x", Output: "bd7b41f400000000000000000000000000000000000000000000000000000000"},
- "v": TestCase{InputSum: csum, InputFmt: "%v", Output: "bd7b41f400000000000000000000000000000000000000000000000000000000"},
- "70s": TestCase{InputSum: csum, InputFmt: "|% 70s", Output: "| bd7b41f400000000000000000000000000000000000000000000000000000000"},
- "#180v": TestCase{InputSum: csum, InputFmt: "%#180v", Output: " btrfs.CSum{0xbd, 0x7b, 0x41, 0xf4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}"},
- }
- for tcName, tc := range testcases {
- tc := tc
- t.Run(tcName, func(t *testing.T) {
- t.Parallel()
- actual := fmt.Sprintf(tc.InputFmt, tc.InputSum)
- assert.Equal(t, tc.Output, actual)
- })
- }
-}