(t *testing.T)
| 668 | } |
| 669 | |
| 670 | func TestRunDepsModeRenderedOutputAndMainTreeModes(t *testing.T) { |
| 671 | if !scanner.NewAstGrepAnalyzer().Available() { |
| 672 | t.Skip("ast-grep not available") |
| 673 | } |
| 674 | |
| 675 | root := t.TempDir() |
| 676 | writeImportersFixture(t, root) |
| 677 | |
| 678 | stdout, _ := captureMainStreams(t, func() { |
| 679 | runDepsMode(root, root, false, "main", nil, false) |
| 680 | }) |
| 681 | if !strings.Contains(stdout, "Dependency Flow") { |
| 682 | t.Fatalf("expected rendered dependency graph output, got:\n%s", stdout) |
| 683 | } |
| 684 | |
| 685 | stdout = runMainWithArgs(t, []string{"codemap", root}) |
| 686 | if !strings.Contains(stdout, "Files:") { |
| 687 | t.Fatalf("expected tree mode output, got:\n%s", stdout) |
| 688 | } |
| 689 | |
| 690 | stdout = runMainWithArgs(t, []string{"codemap", "--skyline", root}) |
| 691 | if strings.TrimSpace(stdout) == "" { |
| 692 | t.Fatal("expected skyline output") |
| 693 | } |
| 694 | } |
| 695 | |
| 696 | func TestSubcommandDispatchViaBinary(t *testing.T) { |
| 697 | root := t.TempDir() |
nothing calls this directly
no test coverage detected