From d5ba08063c9aaf295d172d117ad2e3aeeae0b096 Mon Sep 17 00:00:00 2001 From: Priyanshu Singh <123263608+dev-priyanshu15@users.noreply.github.com> Date: Sat, 12 Oct 2024 16:01:20 +0530 Subject: [PATCH] Create adler32_test.go add hacktoberfest label --- checksum/adler32_test.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 checksum/adler32_test.go diff --git a/checksum/adler32_test.go b/checksum/adler32_test.go new file mode 100644 index 000000000..3d040799e --- /dev/null +++ b/checksum/adler32_test.go @@ -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) + if got != tt.expected { + t.Errorf("Adler32Hex(%q) = %q; want %q", tt.input, got, tt.expected) + } + }) + } +}