diff options
Diffstat (limited to 'main_test.go')
-rw-r--r-- | main_test.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/main_test.go b/main_test.go index e494dc6..83a1649 100644 --- a/main_test.go +++ b/main_test.go @@ -63,5 +63,31 @@ func TestFullyIncludes(t *testing.T) { } }) } +} +func TestHashStr(t *testing.T) { + cases := []struct { + Input string + Want string + Description string + }{ + { + Input: "Let's Play Reļ¼Kinder [Rpg Maker Horror] #5 - Im Meer der traurigen Erinnerungen [iU9Un035p3A].opus", + Want: "b047af2cb102a2a6b15007108f99cfef", + Description: "sum of filename example", + }, + { + Input: "", + Want: "d41d8cd98f00b204e9800998ecf8427e", + Description: "sum of empty string", + }, + } + for i, tc := range cases { + t.Run(fmt.Sprintf("run: #%d; %q", i, tc.Description), func(t *testing.T) { + got := hashStr(tc.Input) + if got != tc.Want { + t.Errorf("want: %v; got: %v", tc.Want, got) + } + }) + } } |