github.com/angenalZZZ/gofunc@v0.0.0-20210507121333-48ff1be3917b/f/exec_command_test.go (about)

     1  package f
     2  
     3  import (
     4  	"testing"
     5  )
     6  
     7  func TestExecCommandOutputScanner(t *testing.T) {
     8  	name := "guid.exe"
     9  	if err := ExecCommandOutputScanner(name, []string{"-n=3"}, func(line []byte) bool {
    10  		t.Logf("%s\n", line)
    11  		return false
    12  	}); err != nil {
    13  		t.Fatal(err)
    14  	}
    15  }