I have read doc test documentation. And apply it in my project but I couldn’t figure this out.
If my output is very long like a query then How can i split it on multiple line .
iex> query_opts = %{
...> "$select" => %{"$fields" => ["name", "designation", "experience_years"]},
...> "$where" => %{"designation" => %{"$ilike" => "%surge %"}},
...> "$order" => %{"rating" => "$asc"}
...> }
iex> #{FatEcto.FatQuery}.build(FatEcto.FatDoctor, query_opts)
#Ecto.Query<from f in FatEcto.FatDoctor, where: ilike(fragment("(?)::TEXT", f.designation), ^"%surge %") and ^true, order_by: [asc: f.rating], select: map(f, [:name, :designation, :experience_years])>
this works and test passes but i would like the result like this:
#Ecto.Query<from f in FatEcto.FatDoctor, where: ilike(fragment("(?)::TEXT", f.designation), ^"%surge %")
and ^true,
order_by: [asc: f.rating],
select: map(f, [:name, :designation, :experience_years])>
It fails because I am using line break and the result of this function using spaces:
left: "#Ecto.Query<from f in FatEcto.FatDoctor, where: ilike(fragment(\"(?)::TEXT\", f.designation),
^\"%surge %\") and ^true, order_by: [asc: f.rating], select: map(f, [:name, :designation,
:experience_years])>"
right: "#Ecto.Query<from f in FatEcto.FatDoctor, where: ilike(fragment(\"(?)::TEXT\", f.designation),
^\"%surge %\")\nand ^true,\norder_by: [asc: f.rating],\nselect: map(f, [:name, :designation,
:experience_years])>"
Is there any workaround?
Thanks