Skip to content

Commit

Permalink
Create fletcher32_test.go
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-priyanshu15 authored Oct 12, 2024
1 parent 495cff8 commit 33da304
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions checksum/fletcher32_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package checksum

import "testing"

func TestFletcher32(t *testing.T) {
tests := []struct {
input string
expected string
}{
{"hello", "5E3C5E27"},
{"world", "5E205B9C"},
{"golang", "5E1F73CC"},
{"", "000000FF"},
}

for _, tt := range tests {
t.Run(tt.input, func(t *testing.T) {
got := Fletcher32Hex(tt.input)
if got != tt.expected {
t.Errorf("Fletcher32Hex(%q) = %q; want %q", tt.input, got, tt.expected)
}
})
}
}

0 comments on commit 33da304

Please sign in to comment.