From 57ded2c0151bdf9c71da2073d83ac3021d56f6c8 Mon Sep 17 00:00:00 2001 From: SavagePeanut Date: Mon, 29 Jul 2024 13:40:13 -0500 Subject: add tests for escapting s in matrix --- tests/test_matrix.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/test_matrix.py b/tests/test_matrix.py index 01723a9..e1782d1 100644 --- a/tests/test_matrix.py +++ b/tests/test_matrix.py @@ -301,3 +301,23 @@ def test_weird_utf8(): test = "~\u200b~" formatted_body = "\u200b" assert(format_for_matrix(test) == formatted_body) + + test = "" + formatted_body = "<element>" + assert(format_for_matrix(test) == formatted_body) + + test = "< element >" + formatted_body = "< element >" + assert(format_for_matrix(test) == formatted_body) + + test = "< element>" + formatted_body = "< element>" + assert(format_for_matrix(test) == formatted_body) + + test = "" + formatted_body = "<element >" + assert(format_for_matrix(test) == formatted_body) + + test = " malicious script " + formatted_body = "<element> malicious script </element>" + assert(format_for_matrix(test) == formatted_body) -- cgit v1.2.3