You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

markup_test.go 700 B

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright 2017 The Gitea Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package markup
  5. import (
  6. "testing"
  7. "github.com/stretchr/testify/assert"
  8. )
  9. func TestMisc_IsReadmeFile(t *testing.T) {
  10. trueTestCases := []string{
  11. "readme",
  12. "README",
  13. "readME.mdown",
  14. "README.md",
  15. }
  16. falseTestCases := []string{
  17. "test.md",
  18. "wow.MARKDOWN",
  19. "LOL.mDoWn",
  20. "test",
  21. "abcdefg",
  22. "abcdefghijklmnopqrstuvwxyz",
  23. "test.md.test",
  24. }
  25. for _, testCase := range trueTestCases {
  26. assert.True(t, IsReadmeFile(testCase))
  27. }
  28. for _, testCase := range falseTestCases {
  29. assert.False(t, IsReadmeFile(testCase))
  30. }
  31. }