This commit is contained in:
parent
53d5c60b2e
commit
f0be7fcd1f
2 changed files with 0 additions and 0 deletions
39
bench_test.go
Normal file
39
bench_test.go
Normal file
|
@ -0,0 +1,39 @@
|
|||
package markdown_test
|
||||
|
||||
import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"git.urbach.dev/go/assert"
|
||||
"git.urbach.dev/go/markdown"
|
||||
)
|
||||
|
||||
func BenchmarkSmall(b *testing.B) {
|
||||
small, err := os.ReadFile("testdata/small.md")
|
||||
assert.Nil(b, err)
|
||||
input := string(small)
|
||||
|
||||
for b.Loop() {
|
||||
markdown.Render(input)
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkMedium(b *testing.B) {
|
||||
medium, err := os.ReadFile("testdata/medium.md")
|
||||
assert.Nil(b, err)
|
||||
input := string(medium)
|
||||
|
||||
for b.Loop() {
|
||||
markdown.Render(input)
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkLarge(b *testing.B) {
|
||||
large, err := os.ReadFile("testdata/large.md")
|
||||
assert.Nil(b, err)
|
||||
input := string(large)
|
||||
|
||||
for b.Loop() {
|
||||
markdown.Render(input)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue