MCPcopy Create free account
hub / github.com/github/gh-aw / TestRepoMemoryMaxFileCountValidation

Function TestRepoMemoryMaxFileCountValidation

pkg/workflow/repo_memory_test.go:514–600  ·  view source on GitHub ↗

TestRepoMemoryMaxFileCountValidation tests max-file-count boundary validation

(t *testing.T)

Source from the content-addressed store, hash-verified

512
513// TestRepoMemoryMaxFileCountValidation tests max-file-count boundary validation
514func TestRepoMemoryMaxFileCountValidation(t *testing.T) {
515 tests := []struct {
516 name string
517 maxFileCount int
518 wantError bool
519 errorText string
520 }{
521 {
522 name: "valid minimum count (1 file)",
523 maxFileCount: 1,
524 wantError: false,
525 },
526 {
527 name: "valid maximum count (1000 files)",
528 maxFileCount: 1000,
529 wantError: false,
530 },
531 {
532 name: "valid mid-range count (100 files)",
533 maxFileCount: 100,
534 wantError: false,
535 },
536 {
537 name: "invalid zero count",
538 maxFileCount: 0,
539 wantError: true,
540 errorText: "max-file-count must be between 1 and 1000, got 0",
541 },
542 {
543 name: "invalid negative count",
544 maxFileCount: -1,
545 wantError: true,
546 errorText: "max-file-count must be between 1 and 1000, got -1",
547 },
548 {
549 name: "invalid count exceeds maximum",
550 maxFileCount: 1001,
551 wantError: true,
552 errorText: "max-file-count must be between 1 and 1000, got 1001",
553 },
554 {
555 name: "invalid large count",
556 maxFileCount: 5000,
557 wantError: true,
558 errorText: "max-file-count must be between 1 and 1000, got 5000",
559 },
560 }
561
562 for _, tt := range tests {
563 t.Run(tt.name, func(t *testing.T) {
564 toolsMap := map[string]any{
565 "repo-memory": map[string]any{
566 "max-file-count": tt.maxFileCount,
567 },
568 }
569
570 toolsConfig, err := ParseToolsConfig(toolsMap)
571 if err != nil {

Callers

nothing calls this directly

Calls 6

ParseToolsConfigFunction · 0.85
NewCompilerFunction · 0.85
RunMethod · 0.45
ErrorfMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected