mirror of
https://github.com/ash-project/ash.git
synced 2024-09-20 21:43:02 +12:00
4153ba7ef3
Co-authored-by: Andreas Donig <git@innwiese.de>
29 lines
867 B
Elixir
29 lines
867 B
Elixir
defmodule Ash.Query.Operator.InTest do
|
|
use ExUnit.Case
|
|
|
|
alias Ash.Query.Operator.Eq
|
|
alias Ash.Query.Operator.In
|
|
|
|
describe "compare/2" do
|
|
test "returns :mutually_inclusive for equal left and right values" do
|
|
left = %In{left: 1, right: MapSet.new([2, 3])}
|
|
right = %In{left: 1, right: MapSet.new([2, 3])}
|
|
|
|
assert In.compare(left, right) == :mutually_inclusive
|
|
end
|
|
|
|
test "returns :mutually_exclusive for different right values" do
|
|
left = %In{left: 1, right: MapSet.new([2, 3])}
|
|
right = %In{left: 1, right: MapSet.new([4, 5])}
|
|
|
|
assert In.compare(left, right) == :mutually_exclusive
|
|
end
|
|
|
|
test "returns :left_includes_left for Eq in In" do
|
|
left = %In{left: 1, right: MapSet.new([2, 3])}
|
|
right = %Eq{left: 1, right: 2}
|
|
|
|
assert In.compare(left, right) == :left_includes_right
|
|
end
|
|
end
|
|
end
|