3cb6c7c6fb
* refactor: move tunnel pkg down one level While there, reduce unnecessary dependency on external packages. * file I forgot to commit
37 lines
697 B
Go
37 lines
697 B
Go
package tunnel
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/apex/log"
|
|
)
|
|
|
|
func TestConfigLoggerDefault(t *testing.T) {
|
|
config := &Config{}
|
|
if config.logger() != defaultLogger {
|
|
t.Fatal("not the logger we expected")
|
|
}
|
|
}
|
|
|
|
func TestConfigLoggerCustom(t *testing.T) {
|
|
config := &Config{Logger: log.Log}
|
|
if config.logger() != log.Log {
|
|
t.Fatal("not the logger we expected")
|
|
}
|
|
}
|
|
|
|
func TestTorBinaryNotSet(t *testing.T) {
|
|
config := &Config{}
|
|
if config.torBinary() != "tor" {
|
|
t.Fatal("not the result we expected")
|
|
}
|
|
}
|
|
|
|
func TestTorBinarySet(t *testing.T) {
|
|
path := "/usr/local/bin/tor"
|
|
config := &Config{TorBinary: path}
|
|
if config.torBinary() != path {
|
|
t.Fatal("not the result we expected")
|
|
}
|
|
}
|