Files
ssh_config/parser_test.go
Sylvie Crowe ed12436768 Allow User to Ignore Match Directive (#5)
* Add the possibility to ignore the Match directive

* cleanup

* cleanup

* cleanup

* cleanup

* fix: duplicated code leftover from merge

* fix: match directive bypass for GetAll

The new ignoreMatchDirective flag needed to be added in one other place.

---------

Co-authored-by: fferro <francesco.ferro@yahooinc.com>
2024-10-27 16:23:32 -07:00

25 lines
430 B
Go

package ssh_config
import (
"errors"
"testing"
)
type errReader struct {
}
func (b *errReader) Read(p []byte) (n int, err error) {
return 0, errors.New("read error occurred")
}
func TestIOError(t *testing.T) {
buf := &errReader{}
_, err := Decode(buf, false)
if err == nil {
t.Fatal("expected non-nil err, got nil")
}
if err.Error() != "read error occurred" {
t.Errorf("expected read error msg, got %v", err)
}
}