aboutsummaryrefslogtreecommitdiff
path: root/matrix/matrix_test.go
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2018-05-02 23:45:17 +0300
committerTulir Asokan <tulir@maunium.net>2018-05-02 23:52:38 +0300
commita9390d3b5c308ccab7f15748a6187865988dafe2 (patch)
treee54410188cbbbd9e33a607411ba44301faa46208 /matrix/matrix_test.go
parent9dabaa26c7fa9bd79805b0dbd626c5386f805afb (diff)
Add more session and config tests
Diffstat (limited to 'matrix/matrix_test.go')
-rw-r--r--matrix/matrix_test.go27
1 files changed, 26 insertions, 1 deletions
diff --git a/matrix/matrix_test.go b/matrix/matrix_test.go
index c5acda8..35debe1 100644
--- a/matrix/matrix_test.go
+++ b/matrix/matrix_test.go
@@ -14,4 +14,29 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
-package matrix_test
+package matrix
+
+import (
+ "testing"
+ "maunium.net/go/gomuks/config"
+ "github.com/stretchr/testify/assert"
+)
+
+func TestContainer_InitClient_Empty(t *testing.T) {
+ cfg := config.NewConfig("/tmp/gomuks-mxtest-0", "/tmp/gomuks-mxtest-0")
+ cfg.HS = "https://matrix.org"
+ c := Container{config: cfg}
+ assert.Nil(t, c.InitClient())
+}
+
+func TestContainer_renderMarkdown(t *testing.T) {
+ text := "**foo** _bar_"
+ c := Container{}
+ assert.Equal(t, "<strong>foo</strong> <em>bar</em>", c.renderMarkdown(text))
+}
+
+func TestContainer_GetCachePath(t *testing.T) {
+ cfg := config.NewConfig("/tmp/gomuks-mxtest-1", "/tmp/gomuks-mxtest-1")
+ c := Container{config: cfg}
+ assert.Equal(t, "/tmp/gomuks-mxtest-1/media/maunium.net/foobar", c.GetCachePath("maunium.net", "foobar"))
+}