hub/pull_request_test.go

25 строки
452 B
Go
Исходник Обычный вид История

2013-04-28 21:45:00 +04:00
package main
import (
"bufio"
"github.com/bmizerany/assert"
"strings"
"testing"
)
func TestReadTitleAndBody(t *testing.T) {
2013-04-28 21:45:00 +04:00
message := `A title
A title continues
A body
A body continues
# comment
`
r := strings.NewReader(message)
reader := bufio.NewReader(r)
2013-05-28 23:42:11 +04:00
title, body, err := readTitleAndBodyFrom(reader)
2013-04-28 21:45:00 +04:00
assert.Equal(t, nil, err)
assert.Equal(t, "A title A title continues", title)
assert.Equal(t, "A body\nA body continues", body)
}