mirror of
https://github.com/schollz/cowyo.git
synced 2023-08-10 21:13:00 +03:00
Things are working
This commit is contained in:
31
page_test.go
Executable file
31
page_test.go
Executable file
@ -0,0 +1,31 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
// "fmt"
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestGeneral(t *testing.T) {
|
||||
defer os.RemoveAll("data")
|
||||
p := Open("testpage")
|
||||
err := p.Update("**bold**")
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
if strings.TrimSpace(p.RenderedPage) != "<p><strong>bold</strong></p>" {
|
||||
t.Errorf("Did not render: '%s'", p.RenderedPage)
|
||||
}
|
||||
err = p.Update("**bold** and *italic*")
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
p.Save()
|
||||
|
||||
p2 := Open("testpage")
|
||||
if strings.TrimSpace(p2.RenderedPage) != "<p><strong>bold</strong> and <em>italic</em></p>" {
|
||||
t.Errorf("Did not render: '%s'", p2.RenderedPage)
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user