feat: added unit tests

This commit is contained in:
2026-07-24 23:59:41 +05:30
parent e625b29d3c
commit 318295f677
2 changed files with 33 additions and 2 deletions
+23
View File
@@ -0,0 +1,23 @@
package buffer
import (
"bufio"
"strings"
"testing"
)
func TestReadConsole(t *testing.T) {
mockMessage := "Reading for Unit test of readconsole"
inputBuffer := &InputBuffer{
Buffer: "",
Reader: bufio.NewReader(strings.NewReader(mockMessage)),
}
inputBuffer.ReadConsole()
if inputBuffer.Buffer != mockMessage {
t.Errorf("ReadConsole() should be %q but is %q", mockMessage, inputBuffer.Buffer)
}
}