mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-01-01 04:31:45 +08:00
19 lines
657 B
Elixir
19 lines
657 B
Elixir
defmodule LiveBook.Evaluator.StringFormatterTest do
|
|
use ExUnit.Case, async: true
|
|
|
|
alias LiveBook.Evaluator.StringFormatter
|
|
|
|
doctest StringFormatter
|
|
|
|
describe "inspect_as_html/2" do
|
|
test "uses span tags for term highlighting" do
|
|
assert ~s{<span class="list">[</span><span class="number">1</span><span class="list">,</span> <span class="number">2</span><span class="list">]</span>} ==
|
|
StringFormatter.inspect_as_html([1, 2])
|
|
end
|
|
|
|
test "escapes HTML in the inspect result" do
|
|
assert ~s{<span class="string">"1 < 2"</span>} ==
|
|
StringFormatter.inspect_as_html("1 < 2")
|
|
end
|
|
end
|
|
end
|