mirror of
https://github.com/ash-project/ash.git
synced 2024-09-21 05:53:06 +12:00
22 lines
511 B
Elixir
22 lines
511 B
Elixir
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
|