1
0
Fork 0
forked from forgejo/forgejo

Add markup package to prepare for org markup format (#1493)

This commit is contained in:
Lunny Xiao 2017-04-21 15:01:08 +08:00 committed by Kim "BKC" Carlbäcker
parent f0db3da713
commit 52627032bc
6 changed files with 157 additions and 51 deletions

View file

@ -0,0 +1,36 @@
// 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
import (
"testing"
"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",
}
for _, testCase := range trueTestCases {
assert.True(t, IsReadmeFile(testCase))
}
for _, testCase := range falseTestCases {
assert.False(t, IsReadmeFile(testCase))
}
}