Skip to content

Commit

Permalink
add unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Achille Roussel committed May 20, 2016
1 parent c368e43 commit c89f9ac
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,12 @@ func TestNewImageWrap(t *testing.T) {
t.Error("invalid image reference:", ref)
}
}

func TestImageRelease(t *testing.T) {
img := NewImage(gopher)
img.release()

if img.Ref() != nil {
t.Error("invalid non-nil image reference found after releasing")
}
}
2 changes: 1 addition & 1 deletion string_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func TestStringRelease(t *testing.T) {
s := NewString("")
s.release()

if s.ref != nil {
if s.Ref() != nil {
t.Error("releasing didn't set the internal string reference to nil")
}
}

0 comments on commit c89f9ac

Please sign in to comment.