Debian Codegraph @

internal/cli/man_test.go

raw symbols SCIP
1 package cli_testscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/
2
3 import (
4 "stringsscip-go gomod github.com/golang/go/src go1.25 strings/"
5 "testingscip-go gomod github.com/golang/go/src go1.25 testing/"
6 )
7
8 func TestManscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/TestMan().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) {
9 stdout, _, err := runDaselCmdscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/runDaselCmd().([]string{"man"})
10 if err != nil {
11 t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("unexpected error: %v", err)
12 }
13 if stdout == "" {
14 t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().("expected non-empty output")
15 }
16
17 // Roff directives
18 if !stringsscip-go gomod github.com/golang/go/src go1.25 strings/.Containsscip-go gomod github.com/golang/go/src go1.25 strings/Contains().(stdout, ".TH") {
19 t.Errorscip-go gomod github.com/golang/go/src go1.25 testing/common#Error().("expected output to contain .TH roff directive")
20 }
21 if !stringsscip-go gomod github.com/golang/go/src go1.25 strings/.Containsscip-go gomod github.com/golang/go/src go1.25 strings/Contains().(stdout, ".SH") {
22 t.Errorscip-go gomod github.com/golang/go/src go1.25 testing/common#Error().("expected output to contain .SH roff directive")
23 }
24
25 // Description
26 if !stringsscip-go gomod github.com/golang/go/src go1.25 strings/.Containsscip-go gomod github.com/golang/go/src go1.25 strings/Contains().(stdout, "Query and modify data structures") {
27 t.Errorscip-go gomod github.com/golang/go/src go1.25 testing/common#Error().("expected output to contain description text")
28 }
29
30 // Subcommands
31 for _, sub := range []string{"query", "version", "completion", "man"} {
32 if !stringsscip-go gomod github.com/golang/go/src go1.25 strings/.Containsscip-go gomod github.com/golang/go/src go1.25 strings/Contains().(stdout, sub) {
33 t.Errorfscip-go gomod github.com/golang/go/src go1.25 testing/common#Errorf().("expected output to contain subcommand %q", sub)
34 }
35 }
36
37 // Key flags (roff uses \- for dashes)
38 for _, flag := range []string{"in", "out", "compact"} {
39 if !stringsscip-go gomod github.com/golang/go/src go1.25 strings/.Containsscip-go gomod github.com/golang/go/src go1.25 strings/Contains().(stdout, flag) {
40 t.Errorfscip-go gomod github.com/golang/go/src go1.25 testing/common#Errorf().("expected output to contain flag %q", flag)
41 }
42 }
43 }