Sha256: 252dd371c160afeb505953cf2cac2f977e0ab30bc5a7a6a57160201da2318104

Contents?: true

Size: 1.82 KB

Versions: 48

Compression:

Stored size: 1.82 KB

Contents

module MarkdownTest

open NUnit.Framework

open Markdown

[<Test>]
let ``Parses normal text as a paragraph`` () =
    let input = "This will be a paragraph"
    let expected = "<p>This will be a paragraph</p>"
    Assert.That(parse input, Is.EqualTo(expected))
    
[<Test>]
let ``Parsing italics`` () =
    let input = "_This will be italic_"
    let expected = "<p><i>This will be italic</i></p>"
    Assert.That(parse input, Is.EqualTo(expected))

[<Test>]
let ``Parsing bold text`` () =
    let input = "__This will be bold__"
    let expected = "<p><em>This will be bold</em></p>"
    Assert.That(parse input, Is.EqualTo(expected))

[<Test>]
let ``Mixed normal, italics and bold text`` () =
    let input = "This will _be_ __mixed__"
    let expected = "<p>This will <i>be</i> <em>mixed</em></p>"
    Assert.That(parse input, Is.EqualTo(expected))

[<Test>]
let ``With h1 header level`` () =
    let input = "# This will be an h1"
    let expected = "<h1>This will be an h1</h1>"
    Assert.That(parse input, Is.EqualTo(expected))

[<Test>]
let ``With h2 header level`` () =
    let input = "## This will be an h2"
    let expected = "<h2>This will be an h2</h2>"
    Assert.That(parse input, Is.EqualTo(expected))

[<Test>]
let ``With h6 header level`` () =
    let input = "###### This will be an h6"
    let expected = "<h6>This will be an h6</h6>"
    Assert.That(parse input, Is.EqualTo(expected))

[<Test>]
let ``Unordered lists`` () =
    let input = "* Item 1\n* Item 2"
    let expected = "<ul><li>Item 1</li><li>Item 2</li></ul>"
    Assert.That(parse input, Is.EqualTo(expected))

[<Test>]
let ``With a little bit of everything`` () =
    let input = "# Header!\n* __Bold Item__\n* _Italic Item_"
    let expected = "<h1>Header!</h1><ul><li><em>Bold Item</em></li><li><i>Italic Item</i></li></ul>"
    Assert.That(parse input, Is.EqualTo(expected))

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
trackler-2.0.6.32 tracks/fsharp/exercises/markdown/MarkdownTest.fs
trackler-2.0.6.31 tracks/fsharp/exercises/markdown/MarkdownTest.fs
trackler-2.0.6.30 tracks/fsharp/exercises/markdown/MarkdownTest.fs
trackler-2.0.6.29 tracks/fsharp/exercises/markdown/MarkdownTest.fs
trackler-2.0.6.28 tracks/fsharp/exercises/markdown/MarkdownTest.fs
trackler-2.0.6.27 tracks/fsharp/exercises/markdown/MarkdownTest.fs
trackler-2.0.6.26 tracks/fsharp/exercises/markdown/MarkdownTest.fs
trackler-2.0.6.25 tracks/fsharp/exercises/markdown/MarkdownTest.fs
trackler-2.0.6.24 tracks/fsharp/exercises/markdown/MarkdownTest.fs
trackler-2.0.6.23 tracks/fsharp/exercises/markdown/MarkdownTest.fs
trackler-2.0.6.22 tracks/fsharp/exercises/markdown/MarkdownTest.fs
trackler-2.0.6.21 tracks/fsharp/exercises/markdown/MarkdownTest.fs
trackler-2.0.6.20 tracks/fsharp/exercises/markdown/MarkdownTest.fs
trackler-2.0.6.19 tracks/fsharp/exercises/markdown/MarkdownTest.fs
trackler-2.0.6.18 tracks/fsharp/exercises/markdown/MarkdownTest.fs
trackler-2.0.6.17 tracks/fsharp/exercises/markdown/MarkdownTest.fs
trackler-2.0.6.16 tracks/fsharp/exercises/markdown/MarkdownTest.fs
trackler-2.0.6.15 tracks/fsharp/exercises/markdown/MarkdownTest.fs
trackler-2.0.6.14 tracks/fsharp/exercises/markdown/MarkdownTest.fs
trackler-2.0.6.13 tracks/fsharp/exercises/markdown/MarkdownTest.fs