1// Copyright 2014 go-dockerclient authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5package docker
6
7import "testing"
8
9func TestChangeString(t *testing.T) {
10	t.Parallel()
11	var tests = []struct {
12		change   Change
13		expected string
14	}{
15		{Change{"/etc/passwd", ChangeModify}, "C /etc/passwd"},
16		{Change{"/etc/passwd", ChangeAdd}, "A /etc/passwd"},
17		{Change{"/etc/passwd", ChangeDelete}, "D /etc/passwd"},
18		{Change{"/etc/passwd", 33}, " /etc/passwd"},
19	}
20	for _, tt := range tests {
21		if got := tt.change.String(); got != tt.expected {
22			t.Errorf("Change.String(): want %q. Got %q.", tt.expected, got)
23		}
24	}
25}
26