func TestTransformError(t *testing.T) { e := errors.New("foo") s, err := ghtasklists.Transform(errReader{e: e}) assert.Equal(t, e, err) assert.Equal(t, "", s) }
func main() { s, err := ghtasklists.Transform(os.Stdin) if err != nil { fmt.Fprintf(os.Stderr, "Error: %v\n", err) os.Exit(1) } fmt.Println(s) }
func TestTransform(t *testing.T) { input := ` foo bar qux choucroute` output := `- [ ] foo - [ ] bar qux - [ ] choucroute ` s, e := ghtasklists.Transform(strings.NewReader(input)) assert.Nil(t, e) assert.Equal(t, output, s) }
func TestTransformEmpty(t *testing.T) { s, e := ghtasklists.Transform(eofReader{}) assert.Nil(t, e) assert.Equal(t, "", s) }