github.com/jgarto/itcv@v0.0.0-20180826224514-4eea09c1aa0d/cmd/stateGen/state_gen_test.go (about)

     1  package main
     2  
     3  import (
     4  	"bytes"
     5  	"os"
     6  	"path/filepath"
     7  	"testing"
     8  )
     9  
    10  func TestTestFiles(t *testing.T) {
    11  	wd, err := os.Getwd()
    12  	if err != nil {
    13  		panic(err)
    14  	}
    15  
    16  	stderr := bytes.NewBuffer(nil)
    17  
    18  	dir := filepath.Join(wd, "_testFiles")
    19  
    20  	ok := dogen(stderr, dir, "")
    21  
    22  	if !ok {
    23  		t.Fatalf("expected gen to be ok; wasn't:\n\n%v", stderr.String())
    24  	}
    25  }