Skip to content

Commit

Permalink
Fix broken test in windows
Browse files Browse the repository at this point in the history
  • Loading branch information
nao1215 committed Oct 21, 2023
1 parent 9c0d8f2 commit f01f1b4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,20 @@ package markdown_test

import (
"os"
"runtime"

"github.com/go-spectest/markdown"
)

func Example() {
// Skip this test on Windows.
// The newline codes in the comment section where
// the expected values are written are represented as '\n',
// causing failures when testing on Windows.
if runtime.GOOS == "windows" {
return
}

markdown.NewMarkdown(os.Stdout).
H1("This is H1").
PlainText("This is plain text").
Expand Down
1 change: 1 addition & 0 deletions markdown.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ func (m *Markdown) Table(t TableSet) *Markdown {

buf := &strings.Builder{}
table := tablewriter.NewWriter(buf)
table.SetNewLine(lineFeed())
table.SetBorders(tablewriter.Border{Left: true, Top: false, Right: true, Bottom: false})
table.SetCenterSeparator("|")
table.SetHeader(t.Header)
Expand Down

0 comments on commit f01f1b4

Please sign in to comment.