hub/pull_request_test.go

25 строки
452 B
Go

package main
import (
"bufio"
"github.com/bmizerany/assert"
"strings"
"testing"
)
func TestReadTitleAndBody(t *testing.T) {
message := `A title
A title continues
A body
A body continues
# comment
`
r := strings.NewReader(message)
reader := bufio.NewReader(r)
title, body, err := readTitleAndBodyFrom(reader)
assert.Equal(t, nil, err)
assert.Equal(t, "A title A title continues", title)
assert.Equal(t, "A body\nA body continues", body)
}