Skip to content

Commit

Permalink
Create adler32_test.go
Browse files Browse the repository at this point in the history
add hacktoberfest label
  • Loading branch information
dev-priyanshu15 authored Oct 12, 2024
1 parent 495cff8 commit d5ba080
Showing 1 changed file with 24 additions and 0 deletions.
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)
}
})
}
}

0 comments on commit d5ba080

Please sign in to comment.