summaryrefslogtreecommitdiff
path: root/common_test.go
diff options
context:
space:
mode:
authorEyal Posener <[email protected]>2017-05-13 11:05:38 +0300
committerEyal Posener <[email protected]>2017-05-13 11:07:03 +0300
commit3de2e3534fb3320081efe100b4da83f034d7155c (patch)
treeeac3857f12dd1f364c941d0f2d69a0182e806ff6 /common_test.go
parent3776c7286e833a6e77db93979c7c1fd01ec8d5fd (diff)
remove testing flags from complete command
Diffstat (limited to 'common_test.go')
-rw-r--r--common_test.go26
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)
+ }
+ })
+}