mirror of
https://git.mills.io/saltyim/saltyim.git
synced 2024-06-16 03:48:24 +00:00
![James Mills](/assets/img/avatar_default.png)
Co-authored-by: James Mills <1290234+prologic@users.noreply.github.com> Reviewed-on: https://git.mills.io/saltyim/saltyim/pulls/180
19 lines
355 B
Go
19 lines
355 B
Go
package saltyim
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestParseAddr(t *testing.T) {
|
|
assert := assert.New(t)
|
|
require := require.New(t)
|
|
|
|
addr, err := ParseAddr("alice@example.com")
|
|
require.NoError(err)
|
|
assert.Equal("alice", addr.User())
|
|
assert.Equal("example.com", addr.Domain())
|
|
}
|