diff options
author | tusooa <tusooa@kazv.moe> | 2023-07-07 07:09:35 -0400 |
---|---|---|
committer | tusooa <tusooa@kazv.moe> | 2023-07-07 07:09:35 -0400 |
commit | 1459d64508b10725231d8f4256fbc68166c1b8ae (patch) | |
tree | ca1ab093358a2448c50c43bae24d97a179d8cd39 /test | |
parent | ba3aa4f86da77ece8ac472c40da180ab1921c304 (diff) | |
download | pleroma-1459d64508b10725231d8f4256fbc68166c1b8ae.tar.gz pleroma-1459d64508b10725231d8f4256fbc68166c1b8ae.zip |
Make regex-to-string descriptor reusable
Diffstat (limited to 'test')
-rw-r--r-- | test/pleroma/web/activity_pub/mrf/utils_test.exs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/pleroma/web/activity_pub/mrf/utils_test.exs b/test/pleroma/web/activity_pub/mrf/utils_test.exs new file mode 100644 index 000000000..3bbc2cfd3 --- /dev/null +++ b/test/pleroma/web/activity_pub/mrf/utils_test.exs @@ -0,0 +1,19 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2023 Pleroma Authors <https://pleroma.social/> +# SPDX-License-Identifier: AGPL-3.0-only + +defmodule Pleroma.Web.ActivityPub.MRF.UtilsTest do + use Pleroma.DataCase, async: true + + alias Pleroma.Web.ActivityPub.MRF.Utils + + describe "describe_regex_or_string/1" do + test "describes regex" do + assert "~r/foo/i" == Utils.describe_regex_or_string(~r/foo/i) + end + + test "returns string as-is" do + assert "foo" == Utils.describe_regex_or_string("foo") + end + end +end |