File: error_test.go

package info (click to toggle)
runc 0.1.1%2Bdfsg1-1~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 1,616 kB
  • sloc: ansic: 365; sh: 156; makefile: 71
file content (20 lines) | stat: -rw-r--r-- 536 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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",
	}

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