diff --git a/entity/bookmark_test.go b/entity/bookmark_test.go new file mode 100644 index 0000000..54ec9c7 --- /dev/null +++ b/entity/bookmark_test.go @@ -0,0 +1,22 @@ +package entity + +import ( + "testing" +) + +func TestTitle(t *testing.T) { + bm := Bookmark{ + URL: "http://example.org", + Info: PageInfo{ + Title: "", + }, + } + if bm.DisplayTitle() != "http://example.org" { + t.Errorf("title incorrect - got %s", bm.DisplayTitle()) + } + bm.Info.Title = "Example Site" + if bm.DisplayTitle() != "Example Site" { + t.Errorf("title incorrect - got %s", bm.DisplayTitle()) + } + +}