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

@@ -27,7 +27,7 @@ import (
"net/http/httptest"
"net/url"
"os"
// "reflect"
"reflect"
"strings"
"testing"
"time"
@@ -64,7 +64,7 @@ func TestRequestWithErrorWontChange(t *testing.T) {
if changed != &r {
t.Errorf("returned request should point to the same object")
}
if !api.Semantic.DeepDerivative(changed, &original) {
if !reflect.DeepEqual(changed, &original) {
t.Errorf("expected %#v, got %#v", &original, changed)
}
}