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

Function TestValidate_StrictMode

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

Source from the content-addressed store, hash-verified

436}
437
438func TestValidate_StrictMode(t *testing.T) {
439 task := &model.Task{
440 ID: "001",
441 Title: "Test Task",
442 // Missing optional fields: Status, Priority, Effort, Group, Tags, Body
443 }
444
445 // Non-strict mode should not produce warnings
446 v := NewValidator(false)
447 result := v.Validate([]*model.Task{task})
448
449 if result.Warnings > 0 {
450 t.Errorf("Non-strict mode should not produce warnings, got %d", result.Warnings)
451 }
452
453 // Strict mode should produce warnings for missing optional fields
454 vStrict := NewValidator(true)
455 resultStrict := vStrict.Validate([]*model.Task{task})
456
457 // Should have warnings for: status, priority, effort, group, tags, body = 6 warnings
458 if resultStrict.Warnings < 5 {
459 t.Errorf("Strict mode should produce multiple warnings, got %d", resultStrict.Warnings)
460 for _, issue := range resultStrict.Issues {
461 t.Logf(" Issue: [%s] %s", issue.Level, issue.Message)
462 }
463 }
464}
465
466func TestValidationResult_IsValid(t *testing.T) {
467 tests := []struct {

Callers

nothing calls this directly

Calls 2

ValidateMethod · 0.95
NewValidatorFunction · 0.85

Tested by

no test coverage detected