That doesn’t seem to work . The difference is in the file path. Here is the console output:
left: %Ecto.Query{assocs: [], distinct: nil, from: {"", QM.Test.Model}, group_bys: [], havings: [], joins: [], limit: nil, lock: nil, offset: nil, order_bys: [], prefix: nil, preloads: [], select: nil, sources: nil, updates: [], wheres: [%Ecto.Query.BooleanExpr{expr: {:like, [], [{{:., [], [{:&, [], [0]}, :first_name]}, [], []}, {:^, [], [0]}]}, op: :and, params: [{"%Ham %", :string}], file: "lib/query/where.ex", line: 121}]}
right: %Ecto.Query{assocs: [], distinct: nil, from: {"", QM.Test.Model}, group_bys: [], havings: [], joins: [], limit: nil, lock: nil, offset: nil, order_bys: [], prefix: nil, preloads: [], select: nil, sources: nil, updates: [], wheres: [%Ecto.Query.BooleanExpr{expr: {:like, [], [{{:., [], [{:&, [], [0]}, :first_name]}, [], []}, {:^, [], [0]}]}, op: :and, params: [{"%Ham %", :string}], file: "/home/sherlock/Documents/Company/elixir_umbrella/apps/fat_ecto/test/QM Test Cases/where QM.exs", line: 13}]}
If you see in the last under file.They both point to two different files.One point to the file where build
function is written and the other to the test file.
And it failed