mirror of
https://github.com/rjNemo/go-wiki
synced 2026-06-06 02:36:40 +00:00
17 lines
559 B
Go
17 lines
559 B
Go
package models
|
|
|
|
import "testing"
|
|
|
|
func TestBlankPage(t *testing.T) {
|
|
ans := BlankPage()
|
|
if ans.title != "Empty page" && string(ans.body) != "Write some content" {
|
|
t.Errorf("BlankPage() = %v; want &Page{title: 'Empty page', body: []byte('Write some content')}", ans)
|
|
}
|
|
}
|
|
|
|
func TestNewPage(t *testing.T) {
|
|
ans := NewPage("Test Page", []byte("This is a sample page"))
|
|
if ans.title != "Test Page" && string(ans.body) != "This is a sample page" {
|
|
t.Errorf("NewPage() = %v; want &Page{title: 'Test Page', body: []byte('This is a sample page')}", ans)
|
|
}
|
|
}
|