mirror of
https://github.com/coder/coder.git
synced 2025-07-13 21:36:50 +00:00
feat(docs): rework CLI docs (#6312)
This commit is contained in:
40
scripts/clidocgen/gen_test.go
Normal file
40
scripts/clidocgen/gen_test.go
Normal file
@ -0,0 +1,40 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
_ "embed"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func Test_parseEnv(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
type args struct {
|
||||
flagUsage string
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
args args
|
||||
want string
|
||||
}{
|
||||
{
|
||||
"no env",
|
||||
args{"Perform a trial run with no changes made, showing a diff at the end."},
|
||||
"",
|
||||
},
|
||||
{
|
||||
"env",
|
||||
args{`Specifies the path to an SSH config.
|
||||
Consumes $CODER_SSH_CONFIG_FILE`},
|
||||
"$CODER_SSH_CONFIG_FILE",
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
tt := tt
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
if got := parseEnv(tt.args.flagUsage); got != tt.want {
|
||||
t.Errorf("parseEnv() = %v, want %v", got, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user