Skip to content

Commit

Permalink
Add dummy output to main
Browse files Browse the repository at this point in the history
Empty main has a code coverage of 0%, unlike lab-06.
  • Loading branch information
patrickmarabeas committed Aug 19, 2019
1 parent 8efff56 commit add520a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
12 changes: 10 additions & 2 deletions 07_errors/patrickmarabeas/main.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
package main

func main() {
import (
"fmt"
"io"
"os"
)

var out io.Writer = os.Stdout

}
func main() {
fmt.Fprint(out, "hello")
}
6 changes: 1 addition & 5 deletions 07_errors/patrickmarabeas/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,16 @@ package main

import (
"bytes"
"io"
"os"
"testing"
)

var out io.Writer = os.Stdout

func TestMainOutput(t *testing.T) {
var buf bytes.Buffer
out = &buf

main()

expected := ""
expected := "hello"

got := buf.String()

Expand Down

0 comments on commit add520a

Please sign in to comment.