From 686fef59db4c2489b8de1d6aa7f9f06066ff06bc Mon Sep 17 00:00:00 2001 From: tusooa Date: Sat, 5 Nov 2022 23:36:10 -0400 Subject: Test that zwnj is treated as word char in hashtags --- test/pleroma/web/common_api_test.exs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test') diff --git a/test/pleroma/web/common_api_test.exs b/test/pleroma/web/common_api_test.exs index 44355c26d..2876d4093 100644 --- a/test/pleroma/web/common_api_test.exs +++ b/test/pleroma/web/common_api_test.exs @@ -518,6 +518,15 @@ defmodule Pleroma.Web.CommonAPITest do assert Object.tags(object) == ["2hu"] end + test "zwnj is treated as word character" do + user = insert(:user) + {:ok, activity} = CommonAPI.post(user, %{status: "#ساٴين‌س"}) + + object = Object.normalize(activity, fetch: false) + + assert Object.tags(object) == ["ساٴين‌س"] + end + test "it adds emoji in the object" do user = insert(:user) {:ok, activity} = CommonAPI.post(user, %{status: ":firefox:"}) -- cgit v1.2.3 From 09ed8f4f8a7573a953c60def1e4506a140b49221 Mon Sep 17 00:00:00 2001 From: tusooa Date: Fri, 6 Jan 2023 14:11:56 -0500 Subject: Test double dot link --- test/pleroma/web/common_api_test.exs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test') diff --git a/test/pleroma/web/common_api_test.exs b/test/pleroma/web/common_api_test.exs index 2876d4093..5c9103e9f 100644 --- a/test/pleroma/web/common_api_test.exs +++ b/test/pleroma/web/common_api_test.exs @@ -527,6 +527,16 @@ defmodule Pleroma.Web.CommonAPITest do assert Object.tags(object) == ["ساٴين‌س"] end + test "double dot in link is allowed" do + user = insert(:user) + text = "https://example.to/something..mp3" + {:ok, activity} = CommonAPI.post(user, %{status: text}) + + object = Object.normalize(activity, fetch: false) + + assert object.data["content"] == "#{text}" + end + test "it adds emoji in the object" do user = insert(:user) {:ok, activity} = CommonAPI.post(user, %{status: ":firefox:"}) -- cgit v1.2.3