40 lines
645 B
Go
40 lines
645 B
Go
package markdown_test
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
|
|
"git.akyoto.dev/go/assert"
|
|
"git.akyoto.dev/go/markdown"
|
|
)
|
|
|
|
func BenchmarkSmall(b *testing.B) {
|
|
small, err := os.ReadFile("testdata/small.md")
|
|
assert.Nil(b, err)
|
|
input := string(small)
|
|
|
|
for range b.N {
|
|
markdown.Render(input)
|
|
}
|
|
}
|
|
|
|
func BenchmarkMedium(b *testing.B) {
|
|
medium, err := os.ReadFile("testdata/medium.md")
|
|
assert.Nil(b, err)
|
|
input := string(medium)
|
|
|
|
for range b.N {
|
|
markdown.Render(input)
|
|
}
|
|
}
|
|
|
|
func BenchmarkLarge(b *testing.B) {
|
|
small, err := os.ReadFile("testdata/large.md")
|
|
assert.Nil(b, err)
|
|
input := string(small)
|
|
|
|
for range b.N {
|
|
markdown.Render(input)
|
|
}
|
|
}
|