mirror of
https://github.com/genuinetools/reg.git
synced 2024-09-12 14:21:01 -04:00
20 lines
536 B
Go
20 lines
536 B
Go
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)
|
|
}
|
|
}
|
|
}
|