Add markup package to prepare for org markup format (#1493)
This commit is contained in:
parent
f0db3da713
commit
52627032bc
6 changed files with 157 additions and 51 deletions
|
@ -1,3 +1,7 @@
|
|||
// Copyright 2017 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package markdown_test
|
||||
|
||||
import (
|
||||
|
@ -586,31 +590,6 @@ func TestMisc_IsMarkdownFile(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestMisc_IsReadmeFile(t *testing.T) {
|
||||
trueTestCases := []string{
|
||||
"readme",
|
||||
"README",
|
||||
"readME.mdown",
|
||||
"README.md",
|
||||
}
|
||||
falseTestCases := []string{
|
||||
"test.md",
|
||||
"wow.MARKDOWN",
|
||||
"LOL.mDoWn",
|
||||
"test",
|
||||
"abcdefg",
|
||||
"abcdefghijklmnopqrstuvwxyz",
|
||||
"test.md.test",
|
||||
}
|
||||
|
||||
for _, testCase := range trueTestCases {
|
||||
assert.True(t, IsReadmeFile(testCase))
|
||||
}
|
||||
for _, testCase := range falseTestCases {
|
||||
assert.False(t, IsReadmeFile(testCase))
|
||||
}
|
||||
}
|
||||
|
||||
func TestMisc_IsSameDomain(t *testing.T) {
|
||||
setting.AppURL = AppURL
|
||||
setting.AppSubURL = AppSubURL
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue