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

25 lines
665 B

  1. // Copyright 2018 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 TestRenderCSV(t *testing.T) {
  10. var parser Parser
  11. var kases = map[string]string{
  12. "a": "<table class=\"table\"><tr><td>a</td><tr></table>",
  13. "1,2": "<table class=\"table\"><tr><td>1</td><td>2</td><tr></table>",
  14. "<br/>": "<table class=\"table\"><tr><td>&lt;br/&gt;</td><tr></table>",
  15. }
  16. for k, v := range kases {
  17. res := parser.Render([]byte(k), "", nil, false)
  18. assert.EqualValues(t, v, string(res))
  19. }
  20. }