summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHaelwenn (lanodan) Monnier <contact@hacktivis.me>2024-01-25 00:26:55 +0100
committerHaelwenn (lanodan) Monnier <contact@hacktivis.me>2024-01-26 16:18:29 +0100
commit0de1a7629c5dbf3f6fba69a41bbeff5947558899 (patch)
tree83d52739e7238f8693fb4a054c4c2885917b972c /test
parent626c22961f7eb0bfc8735a11ef005e5b991f75ce (diff)
Maps: Add filter_empty_values/1
Diffstat (limited to 'test')
-rw-r--r--test/pleroma/maps_test.exs22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/pleroma/maps_test.exs b/test/pleroma/maps_test.exs
new file mode 100644
index 000000000..05f1b18b2
--- /dev/null
+++ b/test/pleroma/maps_test.exs
@@ -0,0 +1,22 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2024 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Pleroma.MapsTest do
+ use Pleroma.DataCase, async: true
+
+ alias Pleroma.Maps
+
+ describe "filter_empty_values/1" do
+ assert %{"bar" => "b", "ray" => ["foo"], "objs" => %{"a" => "b"}} ==
+ Maps.filter_empty_values(%{
+ "foo" => nil,
+ "fooz" => "",
+ "bar" => "b",
+ "rei" => [],
+ "ray" => ["foo"],
+ "obj" => %{},
+ "objs" => %{"a" => "b"}
+ })
+ end
+end