diff options
| author | Eyal Posener <[email protected]> | 2017-05-13 11:10:46 +0300 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-05-13 11:10:46 +0300 |
| commit | 758253551ecf81fc5fb107ef8bdad2745d3525fb (patch) | |
| tree | 49ef787eeb6071d84adb7c8f35051d474351f11f /common_test.go | |
| parent | cc2d0e6974a8644191666e9e1e466b06c8bd6cde (diff) | |
| parent | 87f385425a98490ad44c01e33d16e6a4324696f0 (diff) | |
Merge pull request #18 from posener/zsh
zsh support
Diffstat (limited to 'common_test.go')
| -rw-r--r-- | common_test.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/common_test.go b/common_test.go new file mode 100644 index 0000000..38fe5f1 --- /dev/null +++ b/common_test.go @@ -0,0 +1,26 @@ +package complete + +import ( + "os" + "sync" + "testing" +) + +var once = sync.Once{} + +func initTests() { + once.Do(func() { + // Set debug environment variable so logs will be printed + if testing.Verbose() { + os.Setenv(envDebug, "1") + // refresh the logger with environment variable set + Log = getLogger() + } + + // Change to tests directory for testing completion of files and directories + err := os.Chdir("./tests") + if err != nil { + panic(err) + } + }) +} |
