Make unexported fields panic (informatively)

...Also fix some incorrect calls to semantic.DeepEqual, and a bug where
it returned true incorrectly.
This commit is contained in:
Daniel Smith
2015-03-05 16:52:43 -08:00
parent 2902028476
commit 3ef3777192
4 changed files with 44 additions and 10 deletions

View File

@@ -20,6 +20,7 @@ import (
"encoding/json"
"fmt"
"io/ioutil"
"reflect"
"strings"
"testing"
@@ -378,7 +379,7 @@ func TestFillCurrentState(t *testing.T) {
if controller.Status.Replicas != 2 {
t.Errorf("expected 2, got: %d", controller.Status.Replicas)
}
if !api.Semantic.DeepEqual(fakeLister.s, labels.Set(controller.Spec.Selector).AsSelector()) {
if !reflect.DeepEqual(fakeLister.s, labels.Set(controller.Spec.Selector).AsSelector()) {
t.Errorf("unexpected output: %#v %#v", labels.Set(controller.Spec.Selector).AsSelector(), fakeLister.s)
}
}