ash/test/expr_test.exs

23 lines
511 B
Elixir
Raw Normal View History

2024-07-28 09:05:46 +12:00
defmodule Ash.Test.ExprTest do
@moduledoc false
use ExUnit.Case, async: true
import Ash.Expr
describe "determine_types" do
test "it determines the type of an if statement with complex values" do
{:ok, %func{arguments: args}} =
expr(
if fragment("1") do
string_downcase(type("foo", :string))
else
error(Foo, %{bar: "baz"})
end
)
|> Ash.Filter.hydrate_refs(%{})
determine_types(func, args)
end
end
end