rune_test.go 412 B

123456789101112131415161718192021222324
  1. // Copyright 2019 github.com. All rights reserved.
  2. // Use of this source code is governed by github.com.
  3. package util
  4. import (
  5. "fmt"
  6. "testing"
  7. )
  8. func Test_TruncateRune(t *testing.T) {
  9. fmt.Println(TruncateRune(`中
  10. 国★2↓sd人民子弟兵团`, 7))
  11. }
  12. func Test_TruncateRuneNoHtmlTags(t *testing.T) {
  13. fmt.Println(TruncateRuneNoHtmlTags(`中
  14. <div>
  15. 国★2↓sd人民子弟兵团!@@!!#</div>`, 7))
  16. }