1
0
mirror of https://github.com/schollz/cowyo.git synced 2023-08-10 21:13:00 +03:00
cowyo/page_test.go
Zack Scholl e9e513171c Create special folder for tests
Former-commit-id: ae51c6c248baaf996f899e77e760aba1f0c161cf [formerly 7bf4f38602dd6b24f7888d88f18ca6e9cac9b9a3] [formerly 0ef00a42149f4e7724fde45c2a252e9ec7c550f5 [formerly d20e40ca85e6a06d0aba698624e3433e7c5c612a]]
Former-commit-id: 69b97c02f08943de02a1ae58c8291dcae6c56db8 [formerly d229497f2b2159c144939054ad21f57ce380c47e]
Former-commit-id: 3951a8763debafee5f9ddf812fd022c9b5ce2d10
Former-commit-id: 4a1c502ee3
2017-03-23 10:56:53 -06:00

34 lines
697 B
Go
Executable File

package main
import (
// "fmt"
"os"
"strings"
"testing"
)
func TestGeneral(t *testing.T) {
pathToData = "testdata"
os.MkdirAll(pathToData, 0755)
defer os.RemoveAll(pathToData)
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)
}
}