mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
mvcc: make test struct fields unexported
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
This commit is contained in:
parent
fc3b59046f
commit
82a164e3b9
@ -92,9 +92,9 @@ func TestWatcherRequestsCustomID(t *testing.T) {
|
|||||||
// - Make sure the auto-assignment skips over things we manually assigned
|
// - Make sure the auto-assignment skips over things we manually assigned
|
||||||
|
|
||||||
tt := []struct {
|
tt := []struct {
|
||||||
GivenID WatchID
|
givenID WatchID
|
||||||
ExpectedID WatchID
|
expectedID WatchID
|
||||||
ExpectedErr error
|
expectedErr error
|
||||||
}{
|
}{
|
||||||
{1, 1, nil},
|
{1, 1, nil},
|
||||||
{1, 0, ErrWatcherDuplicateID},
|
{1, 0, ErrWatcherDuplicateID},
|
||||||
@ -103,13 +103,13 @@ func TestWatcherRequestsCustomID(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for i, tcase := range tt {
|
for i, tcase := range tt {
|
||||||
id, err := w.Watch(tcase.GivenID, []byte("foo"), nil, 0)
|
id, err := w.Watch(tcase.givenID, []byte("foo"), nil, 0)
|
||||||
if tcase.ExpectedErr != nil || err != nil {
|
if tcase.expectedErr != nil || err != nil {
|
||||||
if err != tcase.ExpectedErr {
|
if err != tcase.expectedErr {
|
||||||
t.Errorf("expected get error %q in test case %q, got %q", tcase.ExpectedErr, i, err)
|
t.Errorf("expected get error %q in test case %q, got %q", tcase.expectedErr, i, err)
|
||||||
}
|
}
|
||||||
} else if tcase.ExpectedID != id {
|
} else if tcase.expectedID != id {
|
||||||
t.Errorf("expected to create ID %d, got %d in test case %d", tcase.ExpectedID, id, i)
|
t.Errorf("expected to create ID %d, got %d in test case %d", tcase.expectedID, id, i)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user