mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: expose formatExamples enterprise commands (#13304)
Exporting it allows enterprise functions to also use it.
This commit is contained in:
@@ -45,7 +45,7 @@ func Test_formatExamples(t *testing.T) {
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
examples []example
|
||||
examples []Example
|
||||
wantMatches []string
|
||||
}{
|
||||
{
|
||||
@@ -55,7 +55,7 @@ func Test_formatExamples(t *testing.T) {
|
||||
},
|
||||
{
|
||||
name: "Output examples",
|
||||
examples: []example{
|
||||
examples: []Example{
|
||||
{
|
||||
Description: "Hello world.",
|
||||
Command: "echo hello",
|
||||
@@ -72,7 +72,7 @@ func Test_formatExamples(t *testing.T) {
|
||||
},
|
||||
{
|
||||
name: "No description outputs commands",
|
||||
examples: []example{
|
||||
examples: []Example{
|
||||
{
|
||||
Command: "echo hello",
|
||||
},
|
||||
@@ -87,7 +87,7 @@ func Test_formatExamples(t *testing.T) {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
got := formatExamples(tt.examples...)
|
||||
got := FormatExamples(tt.examples...)
|
||||
if len(tt.wantMatches) == 0 {
|
||||
require.Empty(t, got)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user