File: error_test.go

package info (click to toggle)
runc 1.0.0~rc93%2Bds1-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,172 kB
  • sloc: sh: 1,679; ansic: 1,039; makefile: 139
file content (25 lines) | stat: -rw-r--r-- 795 bytes parent folder | download | duplicates (7)
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)
		}
	}
}