6
1
mirror of https://git.mills.io/saltyim/saltyim.git synced 2024-06-25 00:08:26 +00:00
prologic-saltyim/assertions_test.go
James Mills 14857206cb Add client e2e integration tests (#180)
Co-authored-by: James Mills <1290234+prologic@users.noreply.github.com>
Reviewed-on: https://git.mills.io/saltyim/saltyim/pulls/180
2023-01-26 22:30:16 +00:00

25 lines
469 B
Go

package saltyim_test
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.yarn.social/lextwt"
)
func assertMessage(t *testing.T, text, user, expected string) {
t.Helper()
assert := assert.New(t)
require := require.New(t)
s, err := lextwt.ParseSalty(text)
require.NoError(err)
st, ok := s.(*lextwt.SaltyText)
require.True(ok)
assert.Equal(st.User.String(), user)
assert.Equal(st.LiteralText(), expected)
}