diff options
author | lain <lain@soykaf.club> | 2019-09-13 16:31:27 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2019-09-13 16:31:27 +0200 |
commit | a7f31bf06cfe3f8e2549393f34d6573854d783c0 (patch) | |
tree | f53d6747ee73044f7b342d3fdae3d30b5b5b3c90 /test/web/admin_api/config_test.exs | |
parent | f649a2e972b70dfefb7bfc110b27a0194cda51c5 (diff) | |
parent | 0d9609894f4f4557da2db62a33da1b8995c9e1d7 (diff) | |
download | pleroma-a7f31bf06cfe3f8e2549393f34d6573854d783c0.tar.gz pleroma-a7f31bf06cfe3f8e2549393f34d6573854d783c0.zip |
Merge remote-tracking branch 'origin/develop' into reactions
Diffstat (limited to 'test/web/admin_api/config_test.exs')
-rw-r--r-- | test/web/admin_api/config_test.exs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/web/admin_api/config_test.exs b/test/web/admin_api/config_test.exs index 3190dc1c8..204446b79 100644 --- a/test/web/admin_api/config_test.exs +++ b/test/web/admin_api/config_test.exs @@ -103,6 +103,30 @@ defmodule Pleroma.Web.AdminAPI.ConfigTest do assert Config.from_binary(binary) == ~r/comp[lL][aA][iI][nN]er/ end + test "link sigil" do + binary = Config.transform("~r/https:\/\/example.com/") + assert binary == :erlang.term_to_binary(~r/https:\/\/example.com/) + assert Config.from_binary(binary) == ~r/https:\/\/example.com/ + end + + test "link sigil with u modifier" do + binary = Config.transform("~r/https:\/\/example.com/u") + assert binary == :erlang.term_to_binary(~r/https:\/\/example.com/u) + assert Config.from_binary(binary) == ~r/https:\/\/example.com/u + end + + test "link sigil with i modifier" do + binary = Config.transform("~r/https:\/\/example.com/i") + assert binary == :erlang.term_to_binary(~r/https:\/\/example.com/i) + assert Config.from_binary(binary) == ~r/https:\/\/example.com/i + end + + test "link sigil with s modifier" do + binary = Config.transform("~r/https:\/\/example.com/s") + assert binary == :erlang.term_to_binary(~r/https:\/\/example.com/s) + assert Config.from_binary(binary) == ~r/https:\/\/example.com/s + end + test "2 child tuple" do binary = Config.transform(%{"tuple" => ["v1", ":v2"]}) assert binary == :erlang.term_to_binary({"v1", :v2}) |