mirror of
https://github.com/onyx-and-iris/aoc2023.git
synced 2024-11-21 18:00:47 +00:00
30 lines
580 B
Go
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"))
|
||
|
})
|
||
|
}
|