File: i023_missing_error_end_codeblock_test.exs

package info (click to toggle)
elixir-earmark-parser 1.4.44-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,148 kB
  • sloc: makefile: 9
file content (33 lines) | stat: -rw-r--r-- 701 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
defmodule Test.Acceptance.Regressions.I023MissingErrorEndCodeblockTest do
  use Support.AcceptanceTestCase

  describe "bad end" do
    test "error message" do
      markdown = """
      ```
        content
      ````
      """

      ast = [pre_code("  content\n````")]
      expected = {:error, ast, [{:error, 1, "Fenced Code Block opened with ``` not closed at end of input"}]}

      assert as_ast(markdown) == expected
    end

    test "no error message" do
      markdown = """
      ```
        content
      ```
      """

      ast = [pre_code("  content")]
      expected = {:ok, ast, []}

      assert as_ast(markdown) == expected
    end
  end
end

#  SPDX-License-Identifier: Apache-2.0