File: common_test.go

package info (click to toggle)
golang-github-posener-complete 1.1+git20180108.57878c9-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 200 kB
  • sloc: sh: 9; makefile: 4
file content (26 lines) | stat: -rw-r--r-- 460 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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)
		}
	})
}