Skip to content

Commit

Permalink
Added markup test for uppercase string sigil with heredoc
Browse files Browse the repository at this point in the history
Relates to p.2 from highlightjs#730

Unfortunately, we do not distinguish s and S sigils with different interpolation rules
  • Loading branch information
Sannis authored and joshgoebel committed Nov 5, 2019
1 parent e946496 commit 253f31e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/markup/elixir/uppercase-string-sigil.expect.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<span class="hljs-class"><span class="hljs-keyword">defmodule</span> <span class="hljs-title">Long</span></span>.Module.Name <span class="hljs-keyword">do</span>
<span class="hljs-variable">@doc</span> ~S<span class="hljs-string">''</span><span class="hljs-string">'
No <span class="hljs-subst">#{interpolation}</span> of any kind.
\000 \x{ff}

\n <span class="hljs-subst">#{\x{ff}</span>}
'</span><span class="hljs-string">''</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">func</span></span>(a, b \\ []), <span class="hljs-symbol">do:</span> <span class="hljs-symbol">:ok</span>

<span class="hljs-variable">@doc</span> ~S<span class="hljs-string">""</span><span class="hljs-string">"
No <span class="hljs-subst">#{interpolation}</span> of any kind.
\000 \x{ff}

\n <span class="hljs-subst">#{\x{ff}</span>}
"</span><span class="hljs-string">""</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">func</span></span>(a, b \\ []), <span class="hljs-symbol">do:</span> <span class="hljs-symbol">:ok</span>
<span class="hljs-keyword">end</span>
17 changes: 17 additions & 0 deletions test/markup/elixir/uppercase-string-sigil.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
defmodule Long.Module.Name do
@doc ~S'''
No #{interpolation} of any kind.
\000 \x{ff}

\n #{\x{ff}}
'''
def func(a, b \\ []), do: :ok

@doc ~S"""
No #{interpolation} of any kind.
\000 \x{ff}

\n #{\x{ff}}
"""
def func(a, b \\ []), do: :ok
end

0 comments on commit 253f31e

Please sign in to comment.