aoc2023/day-15/hasher_test.go
2023-12-16 00:30:07 +00:00

30 lines
580 B
Go

package main
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestHasher(t *testing.T) {
//t.Skip("skipping test")
hash := newHasher()
t.Run("Should produce a hash value 30", func(t *testing.T) {
assert.Equal(t, 30, hash.run("rn=1"))
})
t.Run("Should produce a hash value 253", func(t *testing.T) {
assert.Equal(t, 253, hash.run("cm-"))
})
t.Run("Should produce a hash value 0", func(t *testing.T) {
assert.Equal(t, 0, hash.run("rn"))
})
t.Run("Should produce a hash value 3", func(t *testing.T) {
assert.Equal(t, 3, hash.run("pc"))
})
}