Skip to content

Commit

Permalink
🎨 测试用例
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Nov 7, 2020
1 parent f4b006a commit 7ce6232
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion javascript/lute.min.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions parse/block_ref.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ package parse

import (
"bytes"

"github.com/88250/lute/ast"
"github.com/88250/lute/lex"
"github.com/88250/lute/util"
Expand Down
33 changes: 33 additions & 0 deletions test/block_ref_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Lute - 一款对中文语境优化的 Markdown 引擎,支持 Go 和 JavaScript
// Copyright (c) 2019-present, b3log.org
//
// Lute is licensed under Mulan PSL v2.
// You can use this software according to the terms and conditions of the Mulan PSL v2.
// You may obtain a copy of Mulan PSL v2 at:
// http://license.coscl.org.cn/MulanPSL2
// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
// See the Mulan PSL v2 for more details.

package test

import (
"testing"

"github.com/88250/lute"
)

var blockrefTests = []parseTest{

{"0", "((20201105103725-dd01qas \"思源笔记\"))", "<p>\"思源笔记\"</p>\n"},
}

func TestBlockRef(t *testing.T) {
luteEngine := lute.New()
luteEngine.BlockRef = true
for _, test := range blockrefTests {
html := luteEngine.MarkdownStr(test.name, test.from)
if test.to != html {
t.Fatalf("test case [%s] failed\nexpected\n\t%q\ngot\n\t%q\noriginal markdown text\n\t%q", test.name, test.to, html, test.from)
}
}
}

0 comments on commit 7ce6232

Please sign in to comment.