Sha256: f9519fdbd27f6035098ce394b7a5286d878826ee64b9ccb0efdef5f895c43484

Contents?: true

Size: 1.98 KB

Versions: 326

Compression:

Stored size: 1.98 KB

Contents

if !System.get_env("EXERCISM_TEST_EXAMPLES") do
  Code.load_file("markdown.exs", __DIR__)
end

ExUnit.start
ExUnit.configure exclude: :pending, trace: true

defmodule MarkdownTest do
  use ExUnit.Case

  # @tag :pending
  test "parses normal text as a paragraph" do
    input = "This will be a paragraph"
    expected = "<p>This will be a paragraph</p>"
    assert Markdown.parse(input) == expected
  end

  @tag :pending
  test "parsing italics" do
    input = "_This will be italic_"
    expected = "<p><em>This will be italic</em></p>"
    assert Markdown.parse(input) == expected
  end

  @tag :pending
  test "parsing bold text" do
    input = "__This will be bold__"
    expected = "<p><strong>This will be bold</strong></p>"
    assert Markdown.parse(input) == expected
  end

  @tag :pending
  test "mixed normal, italics and bold text" do
    input = "This will _be_ __mixed__"
    expected = "<p>This will <em>be</em> <strong>mixed</strong></p>"
    assert Markdown.parse(input) == expected
  end

  @tag :pending
  test "with h1 header level" do
    input = "# This will be an h1"
    expected = "<h1>This will be an h1</h1>"
    assert Markdown.parse(input) == expected
  end

  @tag :pending
  test "with h2 header level" do
    input = "## This will be an h2"
    expected = "<h2>This will be an h2</h2>"
    assert Markdown.parse(input) == expected
  end

  @tag :pending
  test "with h6 header level" do
    input = "###### This will be an h6"
    expected = "<h6>This will be an h6</h6>"
    assert Markdown.parse(input) == expected
  end

  @tag :pending
  test "unordered lists" do
    input = "* Item 1\n* Item 2"
    expected = "<ul><li>Item 1</li><li>Item 2</li></ul>"
    assert Markdown.parse(input) == expected
  end

  @tag :pending
  test "with a little bit of everything" do
    input = "# Header!\n* __Bold Item__\n* _Italic Item_"
    expected = "<h1>Header!</h1><ul><li><strong>Bold Item</strong></li><li><em>Italic Item</em></li></ul>"
    assert Markdown.parse(input) == expected
  end
end

Version data entries

326 entries across 326 versions & 1 rubygems

Version Path
trackler-2.2.1.109 tracks/elixir/exercises/markdown/markdown_test.exs
trackler-2.2.1.108 tracks/elixir/exercises/markdown/markdown_test.exs
trackler-2.2.1.107 tracks/elixir/exercises/markdown/markdown_test.exs
trackler-2.2.1.106 tracks/elixir/exercises/markdown/markdown_test.exs
trackler-2.2.1.105 tracks/elixir/exercises/markdown/markdown_test.exs
trackler-2.2.1.104 tracks/elixir/exercises/markdown/markdown_test.exs
trackler-2.2.1.103 tracks/elixir/exercises/markdown/markdown_test.exs
trackler-2.2.1.102 tracks/elixir/exercises/markdown/markdown_test.exs
trackler-2.2.1.101 tracks/elixir/exercises/markdown/markdown_test.exs
trackler-2.2.1.100 tracks/elixir/exercises/markdown/markdown_test.exs
trackler-2.2.1.99 tracks/elixir/exercises/markdown/markdown_test.exs
trackler-2.2.1.98 tracks/elixir/exercises/markdown/markdown_test.exs
trackler-2.2.1.97 tracks/elixir/exercises/markdown/markdown_test.exs
trackler-2.2.1.96 tracks/elixir/exercises/markdown/markdown_test.exs
trackler-2.2.1.95 tracks/elixir/exercises/markdown/markdown_test.exs
trackler-2.2.1.94 tracks/elixir/exercises/markdown/markdown_test.exs
trackler-2.2.1.93 tracks/elixir/exercises/markdown/markdown_test.exs
trackler-2.2.1.92 tracks/elixir/exercises/markdown/markdown_test.exs
trackler-2.2.1.91 tracks/elixir/exercises/markdown/markdown_test.exs
trackler-2.2.1.90 tracks/elixir/exercises/markdown/markdown_test.exs