This commit expands the test coverage for the `chachapoly` package to include error and edge cases. It also adds `go.sum` to the `.gitignore` file.
18 lines
294 B
Go
18 lines
294 B
Go
package lthn
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestHash(t *testing.T) {
|
|
hash := Hash("hello")
|
|
assert.NotEmpty(t, hash)
|
|
}
|
|
|
|
func TestVerify(t *testing.T) {
|
|
hash := Hash("hello")
|
|
assert.True(t, Verify("hello", hash))
|
|
assert.False(t, Verify("world", hash))
|
|
}
|