1package complete
2
3import (
4	"os"
5	"sync"
6	"testing"
7)
8
9var once = sync.Once{}
10
11func initTests() {
12	once.Do(func() {
13		// Set debug environment variable so logs will be printed
14		if testing.Verbose() {
15			os.Setenv(envDebug, "1")
16			// refresh the logger with environment variable set
17			Log = getLogger()
18		}
19
20		// Change to tests directory for testing completion of files and directories
21		err := os.Chdir("./tests")
22		if err != nil {
23			panic(err)
24		}
25	})
26}
27