MCPcopy Create free account
hub / github.com/OpenAtomFoundation/SmartIDE / TestValidate

Function TestValidate

cli/pkg/ssh_config/validators_test.go:23–37  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

21}
22
23func TestValidate(t *testing.T) {
24 for _, tt := range validateTests {
25 err := validate(tt.key, tt.val)
26 if tt.err == "" && err != nil {
27 t.Errorf("validate(%q, %q): got %v, want nil", tt.key, tt.val, err)
28 }
29 if tt.err != "" {
30 if err == nil {
31 t.Errorf("validate(%q, %q): got nil error, want %v", tt.key, tt.val, tt.err)
32 } else if err.Error() != tt.err {
33 t.Errorf("validate(%q, %q): got err %v, want %v", tt.key, tt.val, err, tt.err)
34 }
35 }
36 }
37}
38
39func TestDefault(t *testing.T) {
40 if v := Default("VisualHostKey"); v != "no" {

Callers

nothing calls this directly

Calls 2

validateFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected