mirror of
https://github.com/hanzozt/go-term-markdown.git
synced 2026-10-30 20:38:22 +00:00
39 lines
551 B
Go
39 lines
551 B
Go
package markdown
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestRemoveLineBreak(t *testing.T) {
|
|
tests := []struct {
|
|
input string
|
|
want string
|
|
}{
|
|
{
|
|
"hello\nhello",
|
|
"hello hello",
|
|
},
|
|
{
|
|
"hello \nhello",
|
|
"hello hello",
|
|
},
|
|
{
|
|
"hello\n hello",
|
|
"hello hello",
|
|
},
|
|
{
|
|
" hello hello \n hello hello ",
|
|
" hello hello hello hello ",
|
|
},
|
|
{
|
|
" hello ",
|
|
" hello ",
|
|
},
|
|
}
|
|
for _, tt := range tests {
|
|
assert.Equal(t, tt.want, removeLineBreak(tt.input))
|
|
}
|
|
}
|