Skip to content

Commit

Permalink
Do not double-stringify code
Browse files Browse the repository at this point in the history
  • Loading branch information
angelikatyborska committed Dec 31, 2023
1 parent 5563b02 commit 44e05eb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/support/exercise_test_case.ex
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,16 @@ defmodule ElixirAnalyzer.ExerciseTestCase do

{line, code} =
case code do
{:sigil_S, opts, _} ->
{Keyword.get(opts, :line), code}
{:sigil_S, opts, [{:<<>>, _, [inner_code]}, []]} when is_bitstring(inner_code) ->
{Keyword.get(opts, :line), inner_code}

{_, opts, _} ->
{Keyword.get(opts, :line), Macro.to_string(code)}

_ ->
code when is_bitstring(code) ->
{__CALLER__.line, code}

code ->
{__CALLER__.line, Macro.to_string(code)}
end

Expand Down

0 comments on commit 44e05eb

Please sign in to comment.