X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=test%2Fflake_id_test.exs;h=85ed5bbdff868dd8c494ad296733132b2cdc0ab8;hb=450bf7a63c39c2301d5985448a867e77f1dfe3b3;hp=e480fbdf3f02b5feb469fa3de6fc4e8ea3fd619c;hpb=9d63b27dcd61dff61b77b6df0ef8a4cf8d7c87e3;p=akkoma
diff --git a/test/flake_id_test.exs b/test/flake_id_test.exs
index e480fbdf3..85ed5bbdf 100644
--- a/test/flake_id_test.exs
+++ b/test/flake_id_test.exs
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2018 Pleroma Authors
+# Copyright © 2017-2019 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.FlakeIdTest do
@@ -11,6 +11,7 @@ defmodule Pleroma.FlakeIdTest do
test "from_string/1" do
fake_flake = <<0::integer-size(64), 42::integer-size(64)>>
assert from_string("42") == fake_flake
+ assert from_string(42) == fake_flake
end
test "zero or -1 is a null flake" do
@@ -38,4 +39,9 @@ defmodule Pleroma.FlakeIdTest do
assert dump(flake_s) == {:ok, flake}
assert dump(flake) == {:ok, flake}
end
+
+ test "is_flake_id?/1" do
+ assert is_flake_id?("9eoozpwTul5mjSEDRI")
+ refute is_flake_id?("http://example.com/activities/3ebbadd1-eb14-4e20-8118-b6f79c0c7b0b")
+ end
end