2022-03-17 16:20:59 +01:00
|
|
|
package format_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"strings"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"ewintr.nl/adoc/format"
|
|
|
|
"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()
|
|
|
|
test.Equals(t, exp, format.Text(doc))
|
|
|
|
}
|