File: error_test.go

package info (click to toggle)
runc 1.0.0~rc9+dfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 1,996 kB
  • sloc: sh: 1,422; ansic: 1,008; makefile: 116
file content (25 lines) | stat: -rw-r--r-- 795 bytes parent folder | download | duplicates (6)
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
package libcontainer

import "testing"

func TestErrorCode(t *testing.T) {
	codes := map[ErrorCode]string{
		IdInUse:             "Id already in use",
		InvalidIdFormat:     "Invalid format",
		ContainerPaused:     "Container paused",
		ConfigInvalid:       "Invalid configuration",
		SystemError:         "System error",
		ContainerNotExists:  "Container does not exist",
		ContainerNotStopped: "Container is not stopped",
		ContainerNotRunning: "Container is not running",
		ConsoleExists:       "Console exists for process",
		ContainerNotPaused:  "Container is not paused",
		NoProcessOps:        "No process operations",
	}

	for code, expected := range codes {
		if actual := code.String(); actual != expected {
			t.Fatalf("expected string %q but received %q", expected, actual)
		}
	}
}