Add test
This commit is contained in:
parent
0dccd9f0f0
commit
b50a2aefb6
22
entity/bookmark_test.go
Normal file
22
entity/bookmark_test.go
Normal file
@ -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())
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user