From 44e05ebc0eafcf4d63cb3db0fee651a0e9ba9037 Mon Sep 17 00:00:00 2001 From: Angelika Tyborska Date: Sun, 31 Dec 2023 09:50:34 +0100 Subject: [PATCH] Do not double-stringify code --- test/support/exercise_test_case.ex | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/support/exercise_test_case.ex b/test/support/exercise_test_case.ex index ab4c7330..f0f0582e 100644 --- a/test/support/exercise_test_case.ex +++ b/test/support/exercise_test_case.ex @@ -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