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

Function TestExtractWorkflowDescription

pkg/cli/add_description_test.go:13–98  ·  view source on GitHub ↗

TestExtractWorkflowDescription tests the ExtractWorkflowDescription function

(t *testing.T)

Source from the content-addressed store, hash-verified

11
12// TestExtractWorkflowDescription tests the ExtractWorkflowDescription function
13func TestExtractWorkflowDescription(t *testing.T) {
14 tests := []struct {
15 name string
16 content string
17 expected string
18 }{
19 {
20 name: "workflow with description",
21 content: `---
22name: Test Workflow
23description: This is a test workflow description
24on: push
25---
26
27# Test Workflow
28
29This is the workflow content.`,
30 expected: "This is a test workflow description",
31 },
32 {
33 name: "workflow without description",
34 content: `---
35name: Test Workflow
36on: push
37---
38
39# Test Workflow
40
41This is the workflow content.`,
42 expected: "",
43 },
44 {
45 name: "workflow with empty description",
46 content: `---
47name: Test Workflow
48description: ""
49on: push
50---
51
52# Test Workflow
53
54This is the workflow content.`,
55 expected: "",
56 },
57 {
58 name: "workflow with multi-line description",
59 content: `---
60name: Test Workflow
61description: |
62 This is a multi-line
63 test workflow description
64on: push
65---
66
67# Test Workflow
68
69This is the workflow content.`,
70 expected: "This is a multi-line\ntest workflow description\n",

Callers

nothing calls this directly

Calls 3

RunMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected