diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/main.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/main.cpp b/tests/main.cpp index 0eae9ba..bfece6e 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -121,5 +121,25 @@ int main() { assert_equals(extract_user_name_from_email("@dec05eba:domain.com"), ""); assert_equals(extract_user_name_from_email("dec05eba"), ""); + auto room_ids = matrix_extract_room_ids("hello #sneed:matrix.org world #feed:midov.pl"); + assert_equals(room_ids.size(), 2); + assert_equals(room_ids[0], "#sneed:matrix.org"); + assert_equals(room_ids[1], "#feed:midov.pl"); + + room_ids = matrix_extract_room_ids("#sneed:matrix.org"); + assert_equals(room_ids.size(), 1); + assert_equals(room_ids[0], "#sneed:matrix.org"); + + room_ids = matrix_extract_room_ids("#sneedmatrix.org"); + assert_equals(room_ids.size(), 0); + + room_ids = matrix_extract_room_ids("!sneed:matrix.org"); + assert_equals(room_ids.size(), 0); + //assert_equals(room_ids.size(), 1); + //assert_equals(room_ids[0], "!sneed:matrix.org"); + + room_ids = matrix_extract_room_ids("@sneed:matrix.org"); + assert_equals(room_ids.size(), 0); + return 0; } |