mirror of
https://github.com/go-gitea/gitea.git
synced 2024-10-31 22:42:25 +00:00
0d80af649a
* add init support of orgmode document type on file view and readme * fix imports * fix imports and readmeExist * fix imports order * fix format * remove unnecessary convert
41 lines
807 B
Go
41 lines
807 B
Go
// 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 markup_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
. "code.gitea.io/gitea/modules/markup"
|
|
_ "code.gitea.io/gitea/modules/markup/markdown"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
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",
|
|
"readmf",
|
|
}
|
|
|
|
for _, testCase := range trueTestCases {
|
|
assert.True(t, IsReadmeFile(testCase))
|
|
}
|
|
for _, testCase := range falseTestCases {
|
|
assert.False(t, IsReadmeFile(testCase))
|
|
}
|
|
}
|