This repository has been archived on 2020-04-20. You can view files and clone it, but cannot push or open issues or pull requests.
libricochet-go/connectivity/torProvider_test.go

30 lines
481 B
Go

package connectivity
import (
"fmt"
"testing"
)
func getStatusCallback(progChan chan int) func(int, string) {
return func(prog int, status string) {
fmt.Printf("%v %v\n", prog, status)
progChan <- prog
}
}
func TestTorProvider(t *testing.T) {
progChan := make(chan int)
acn, err := StartTor(".", "")
acn.SetStatusCallback(getStatusCallback(progChan))
if err != nil {
t.Error(err)
}
progress := 0
for progress < 100 {
progress = <-progChan
}
acn.Close()
}