diff options
Diffstat (limited to 'bridge/matrix/matrix_test.go')
-rw-r--r-- | bridge/matrix/matrix_test.go | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/bridge/matrix/matrix_test.go b/bridge/matrix/matrix_test.go new file mode 100644 index 00000000..846d9a43 --- /dev/null +++ b/bridge/matrix/matrix_test.go @@ -0,0 +1,28 @@ +package bmatrix + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestPlainUsername(t *testing.T) { + uut := newMatrixUsername("MyUser") + + assert.Equal(t, "MyUser", uut.formatted) + assert.Equal(t, "MyUser", uut.plain) +} + +func TestHTMLUsername(t *testing.T) { + uut := newMatrixUsername("<b>MyUser</b>") + + assert.Equal(t, "<b>MyUser</b>", uut.formatted) + assert.Equal(t, "MyUser", uut.plain) +} + +func TestFancyUsername(t *testing.T) { + uut := newMatrixUsername("<MyUser>") + + assert.Equal(t, "<MyUser>", uut.formatted) + assert.Equal(t, "<MyUser>", uut.plain) +} |