diff --git a/pkg/index/export_test.go b/pkg/index/export_test.go index cc646273a..bb8feb657 100644 --- a/pkg/index/export_test.go +++ b/pkg/index/export_test.go @@ -123,3 +123,9 @@ func (x *Index) Exp_FixMissingWholeRef(fetcher blob.Fetcher) (err error) { } var Exp_ErrMissingWholeRef = errMissingWholeRef + +var Exp_KeyRecentPermanode = keyRecentPermanode + +func Exp_TypeOfKey(key string) string { + return typeOfKey(key) +} diff --git a/pkg/index/index_test.go b/pkg/index/index_test.go index a09cc1c5e..7db0e56f2 100644 --- a/pkg/index/index_test.go +++ b/pkg/index/index_test.go @@ -79,6 +79,7 @@ var ( "export_test.go", "index_test.go", "keys_test.go", + "util_test.go", } // A map is used in hasAllRequiredTests to note which required // tests have been found in a package, by setting the corresponding diff --git a/pkg/index/keys_test.go b/pkg/index/keys_test.go index 93440ba66..11eb13324 100644 --- a/pkg/index/keys_test.go +++ b/pkg/index/keys_test.go @@ -14,14 +14,16 @@ See the License for the specific language governing permissions and limitations under the License. */ -package index +package index_test import ( "testing" + + "camlistore.org/pkg/index" ) func TestKeyPrefix(t *testing.T) { - if g, e := keyRecentPermanode.Prefix("ABC"), "recpn|ABC|"; g != e { + if g, e := index.Exp_KeyRecentPermanode.Prefix("ABC"), "recpn|ABC|"; g != e { t.Errorf("recpn = %q; want %q", g, e) } } @@ -37,7 +39,7 @@ func TestTypeOfKey(t *testing.T) { {"fooo", ""}, } for _, tt := range tests { - if got := typeOfKey(tt.in); got != tt.want { + if got := index.Exp_TypeOfKey(tt.in); got != tt.want { t.Errorf("typeOfKey(%q) = %q; want %q", tt.in, got, tt.want) } } diff --git a/pkg/index/util_test.go b/pkg/index/util_test.go index ba5c6bbfa..86255ec6b 100644 --- a/pkg/index/util_test.go +++ b/pkg/index/util_test.go @@ -14,13 +14,14 @@ See the License for the specific language governing permissions and limitations under the License. */ -package index +package index_test import ( "testing" "time" "camlistore.org/pkg/blob" + "camlistore.org/pkg/index" "camlistore.org/pkg/types/camtypes" ) @@ -78,7 +79,7 @@ func TestClaimsAttrValue(t *testing.T) { } for i, tt := range tests { - got := ClaimsAttrValue(claims, tt.attr, tt.t, blob.Ref{}) + got := index.ClaimsAttrValue(claims, tt.attr, tt.t, blob.Ref{}) if got != tt.want { t.Errorf("%d. attr %q = %v; want %v", i, tt.attr, got, tt.want)