2022-06-11 09:30:22 +02:00
|
|
|
package formatter_test
|
2022-03-17 16:20:59 +01:00
|
|
|
|
|
|
|
import (
|
|
|
|
"strings"
|
|
|
|
"testing"
|
|
|
|
|
2022-06-11 09:30:22 +02:00
|
|
|
"ewintr.nl/adoc/formatter"
|
2022-03-17 16:20:59 +01:00
|
|
|
"ewintr.nl/adoc/parser"
|
|
|
|
"ewintr.nl/go-kit/test"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestText(t *testing.T) {
|
|
|
|
input := `= A Title
|
|
|
|
|
2022-03-22 06:53:01 +01:00
|
|
|
Some document
|
|
|
|
|
|
|
|
With some text.`
|
2022-03-17 16:20:59 +01:00
|
|
|
|
|
|
|
exp := `A Title
|
|
|
|
|
2022-03-22 06:53:01 +01:00
|
|
|
Some document
|
2022-03-17 16:20:59 +01:00
|
|
|
|
2022-03-22 06:53:01 +01:00
|
|
|
With some text.
|
2022-03-17 16:20:59 +01:00
|
|
|
|
|
|
|
`
|
|
|
|
|
|
|
|
doc := parser.New(strings.NewReader(input)).Parse()
|
2022-06-11 09:30:22 +02:00
|
|
|
test.Equals(t, exp, formatter.NewText().Format(doc))
|
2022-03-17 16:20:59 +01:00
|
|
|
}
|