From 52627032bc55bd73694bea9e6e17df575b51664c Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Fri, 21 Apr 2017 15:01:08 +0800 Subject: Add markup package to prepare for org markup format (#1493) --- modules/markup/markup_test.go | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 modules/markup/markup_test.go (limited to 'modules/markup/markup_test.go') diff --git a/modules/markup/markup_test.go b/modules/markup/markup_test.go new file mode 100644 index 0000000000..92caa8ff96 --- /dev/null +++ b/modules/markup/markup_test.go @@ -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)) + } +} -- cgit v1.2.3