mirror of
				https://codeberg.org/forgejo/forgejo.git
				synced 2025-11-04 08:21:11 +00:00 
			
		
		
		
	* restructure markup & markdown to prepare for multiple markup languages support * adjust some functions between markdown and markup * fix tests * improve the comments
		
			
				
	
	
		
			40 lines
		
	
	
	
		
			800 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			40 lines
		
	
	
	
		
			800 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/markdown"
 | 
						|
	. "code.gitea.io/gitea/modules/markup"
 | 
						|
 | 
						|
	"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))
 | 
						|
	}
 | 
						|
}
 |