Skip to content

Commit d5ba080

Browse files
Create adler32_test.go
add hacktoberfest label
1 parent 495cff8 commit d5ba080

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

checksum/adler32_test.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package checksum
2+
3+
import "testing"
4+
5+
func TestAdler32(t *testing.T) {
6+
tests := []struct {
7+
input string
8+
expected string
9+
}{
10+
{"hello", "1C2C8C41"},
11+
{"world", "1C0E26D2"},
12+
{"golang", "1C1B48C4"},
13+
{"", "00000001"},
14+
}
15+
16+
for _, tt := range tests {
17+
t.Run(tt.input, func(t *testing.T) {
18+
got := Adler32Hex(tt.input)
19+
if got != tt.expected {
20+
t.Errorf("Adler32Hex(%q) = %q; want %q", tt.input, got, tt.expected)
21+
}
22+
})
23+
}
24+
}

0 commit comments

Comments
 (0)