File: incontainer_test.go

package info (click to toggle)
golang-github-calmh-incontainer 0.0~git20221224.b3e71b1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 80 kB
  • sloc: makefile: 2; sh: 1
file content (18 lines) | stat: -rw-r--r-- 363 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package incontainer_test

import (
	"os"
	"testing"

	"github.com/calmh/incontainer"
)

func TestIncontainer(t *testing.T) {
	result := incontainer.Detect()
	if os.Getenv("IN_DOCKER_TEST") == "" {
		t.Skipf("not running in test harness (result: %v)", result)
	}
	if result != true {
		t.Errorf("expected incontainer.Detect() to return true, got %v", result)
	}
}