MCPcopy Create free account
hub / github.com/driangle/taskmd / TestValidationResult_IsValid

Function TestValidationResult_IsValid

sdk/go/validator/validator_test.go:466–508  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

464}
465
466func TestValidationResult_IsValid(t *testing.T) {
467 tests := []struct {
468 name string
469 result *ValidationResult
470 wantValid bool
471 }{
472 {
473 name: "no issues",
474 result: &ValidationResult{},
475 wantValid: true,
476 },
477 {
478 name: "only warnings",
479 result: &ValidationResult{
480 Warnings: 3,
481 },
482 wantValid: true,
483 },
484 {
485 name: "has errors",
486 result: &ValidationResult{
487 Errors: 1,
488 },
489 wantValid: false,
490 },
491 {
492 name: "errors and warnings",
493 result: &ValidationResult{
494 Errors: 1,
495 Warnings: 2,
496 },
497 wantValid: false,
498 },
499 }
500
501 for _, tt := range tests {
502 t.Run(tt.name, func(t *testing.T) {
503 if got := tt.result.IsValid(); got != tt.wantValid {
504 t.Errorf("IsValid() = %v, want %v", got, tt.wantValid)
505 }
506 })
507 }
508}
509
510func TestValidate_ComplexScenario(t *testing.T) {
511 // Create a complex scenario with multiple issues

Callers

nothing calls this directly

Calls 1

IsValidMethod · 0.45

Tested by

no test coverage detected