From c19c0171bb86b73dbfccefac8d6e7e3a6fce3297 Mon Sep 17 00:00:00 2001 From: Kian-Meng Ang Date: Wed, 3 Jul 2024 01:29:11 +0800 Subject: [PATCH] Resolve single quote string warnings (#152) This resolves the following errors during tests: warning: single-quoted strings represent charlists. Use ~c"" if you indeed want a charlist or use "" instead --- test/acceptance/ast/html/permissive_test.exs | 2 +- .../regressions/i002-accept-any-struct-as-option_test.exs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/acceptance/ast/html/permissive_test.exs b/test/acceptance/ast/html/permissive_test.exs index fcff00e..23f9d38 100644 --- a/test/acceptance/ast/html/permissive_test.exs +++ b/test/acceptance/ast/html/permissive_test.exs @@ -27,7 +27,7 @@ defmodule Acceptance.Ast.Html.PermissiveTest do # Needs a fix with issue [#326](https://github.com/pragdave/earmark/issues/326) test "mixture of tags (was regtest #103)" do markdown = "a\n\n\n\n\n\n" - ast = [{"x", '', ["a", "", "", "", "", ""], @verbatim}] + ast = [{"x", ~c"", ["a", "", "", "", "", ""], @verbatim}] messages = Enum.zip([1, 3, 6], ~w[x y z]) |> Enum.map(fn {lnb, tag} -> {:warning, lnb, "Failed to find closing <#{tag}>"} end) diff --git a/test/acceptance/regressions/i002-accept-any-struct-as-option_test.exs b/test/acceptance/regressions/i002-accept-any-struct-as-option_test.exs index f787f0a..8fc5dd5 100644 --- a/test/acceptance/regressions/i002-accept-any-struct-as-option_test.exs +++ b/test/acceptance/regressions/i002-accept-any-struct-as-option_test.exs @@ -16,7 +16,7 @@ defmodule MyStruct do test "or activated" do ast = - [{"p", '', ["see ", {"a", [{"href", "https://my.site.com"}], ["https://my.site.com"], %{}}], %{}}] + [{"p", ~c"", ["see ", {"a", [{"href", "https://my.site.com"}], ["https://my.site.com"], %{}}], %{}}] assert as_ast(@markdown, %MyStruct{pure_links: true}) == {:ok, ast, []} end