Skip to content
Closed
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
24 changes: 24 additions & 0 deletions checksum/adler32_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package checksum

import "testing"

func TestAdler32(t *testing.T) {
tests := []struct {
input string
expected string
}{
{"hello", "1C2C8C41"},
{"world", "1C0E26D2"},
{"golang", "1C1B48C4"},
{"", "00000001"},
}

for _, tt := range tests {
t.Run(tt.input, func(t *testing.T) {
got := Adler32Hex(tt.input)

Check failure on line 18 in checksum/adler32_test.go

View workflow job for this annotation

GitHub Actions / Code style and tests

undefined: Adler32Hex (typecheck)

Check failure on line 18 in checksum/adler32_test.go

View workflow job for this annotation

GitHub Actions / Code style and tests

undefined: Adler32Hex) (typecheck)

Check failure on line 18 in checksum/adler32_test.go

View workflow job for this annotation

GitHub Actions / upload_coverage_report

undefined: Adler32Hex
if got != tt.expected {
t.Errorf("Adler32Hex(%q) = %q; want %q", tt.input, got, tt.expected)
}
})
}
}
Loading