Skip to content
This repository has been archived by the owner on Jul 25, 2024. It is now read-only.

Commit

Permalink
Better test
Browse files Browse the repository at this point in the history
  • Loading branch information
hoffa committed Jun 23, 2023
1 parent bb59456 commit 5b42eb4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions pt.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ func urlJoin(base, p string) string {

func main() {
baseURL := flag.String("base-url", "", "base URL")
pageTemplatePath := flag.String("template", "", "page template")
feedPath := flag.String("feed", "feed.xml", "feed target")
feedTemplatePath := flag.String("feed-template", "", "feed template")
pageTemplatePath := flag.String("template", "", "page template path")
feedPath := flag.String("feed", "feed.xml", "feed target path")
feedTemplatePath := flag.String("feed-template", "", "feed template path")
style := flag.String("highlight", "", "code highlight style")
dir := flag.String("dir", ".", "where to save generated files")
flag.Parse()
Expand Down
7 changes: 4 additions & 3 deletions pt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
)

func TestStdinMarkdown(t *testing.T) {
cmd := exec.Command("go", "run", "pt.go")
cmd.Stdin = strings.NewReader("# Hello!\nSome `cool` _arbitrary_ **Markdown**!")
cmd := exec.Command("go", "run", "pt.go", "-highlight", "monokai")
cmd.Stdin = strings.NewReader("# Hello!\nSome `cool` _arbitrary_ **Markdown**!\n\n```python\nprint(\"Hi!\")\n```")
actual, err := cmd.Output()
check(err)
expected := `<!DOCTYPE html>
Expand All @@ -22,7 +22,8 @@ func TestStdinMarkdown(t *testing.T) {
<h1>Hello!</h1>
<p>Some <code>cool</code> <em>arbitrary</em> <strong>Markdown</strong>!</p>
<pre tabindex="0" style="color:#f8f8f2;background-color:#272822;"><code><span style="display:flex;"><span>print(<span style="color:#e6db74"></span><span style="color:#e6db74">&#34;</span><span style="color:#e6db74">Hi!</span><span style="color:#e6db74">&#34;</span>)
</span></span></code></pre>
</body>
</html>
`
Expand Down

0 comments on commit 5b42eb4

Please sign in to comment.