cli/pkg/io/bench_test.go
Snider 15e9c85995 feat: add tests for edge cases, error paths, and integration scenarios (#308)
Squashed merge of 440 commits from test-audit-improvements-4086316797618135702.

This PR adds comprehensive test coverage including:
- Edge case tests for various packages
- Error path verification
- Integration test scenarios
- Improved test assertions and helpers

Co-authored-by: Claude <developers@lethean.io>
2026-02-05 10:10:07 +00:00

34 lines
638 B
Go

package io
import (
"testing"
)
func BenchmarkMockMedium_Write(b *testing.B) {
m := NewMockMedium()
b.ResetTimer()
for i := 0; i < b.N; i++ {
_ = m.Write("test.txt", "some content")
}
}
func BenchmarkMockMedium_Read(b *testing.B) {
m := NewMockMedium()
_ = m.Write("test.txt", "some content")
b.ResetTimer()
for i := 0; i < b.N; i++ {
_, _ = m.Read("test.txt")
}
}
func BenchmarkMockMedium_List(b *testing.B) {
m := NewMockMedium()
_ = m.EnsureDir("dir")
for i := 0; i < 100; i++ {
_ = m.Write("dir/file"+string(rune(i))+".txt", "content")
}
b.ResetTimer()
for i := 0; i < b.N; i++ {
_, _ = m.List("dir")
}
}