ash/test/ash_test.exs
Zach Daniel 61e6b7c80c fix: various ci_string improvements
feat: add `contains/2` query function
2021-01-23 22:28:56 -05:00

27 lines
630 B
Elixir

defmodule Ash.Test.AshTest do
@moduledoc false
use ExUnit.Case, async: true
describe "non_executable_binary_to_term/1" do
test "it works for simple terms" do
for data <- [nil, %{}, [], "foo", 1, :blah, 1.1] do
result =
data
|> :erlang.term_to_binary()
|> Ash.non_executable_binary_to_term()
assert result == data
end
end
test "it fails on functions" do
func = fn x, y -> x + y end
binary = :erlang.term_to_binary(func)
assert_raise ArgumentError, fn ->
Ash.non_executable_binary_to_term(binary)
end
end
end
end