(t *testing.T)
| 188 | } |
| 189 | |
| 190 | func TestCompileToYAML_BasicCompilation(t *testing.T) { |
| 191 | markdown := `--- |
| 192 | name: compile-test |
| 193 | on: |
| 194 | workflow_dispatch: |
| 195 | engine: copilot |
| 196 | --- |
| 197 | |
| 198 | # Mission |
| 199 | |
| 200 | Greet the user warmly. |
| 201 | ` |
| 202 | |
| 203 | compiler := NewCompiler( |
| 204 | WithNoEmit(true), |
| 205 | WithSkipValidation(true), |
| 206 | ) |
| 207 | |
| 208 | wd, err := compiler.ParseWorkflowString(markdown, "workflow.md") |
| 209 | require.NoError(t, err) |
| 210 | |
| 211 | yaml, err := compiler.CompileToYAML(wd, "workflow.md") |
| 212 | require.NoError(t, err) |
| 213 | assert.NotEmpty(t, yaml) |
| 214 | |
| 215 | // The generated YAML should contain standard GitHub Actions structure |
| 216 | assert.Contains(t, yaml, "name:") |
| 217 | assert.Contains(t, yaml, "on:") |
| 218 | assert.Contains(t, yaml, "jobs:") |
| 219 | } |
| 220 | |
| 221 | func TestCompileToYAML_OutputContainsWorkflowName(t *testing.T) { |
| 222 | markdown := `--- |
nothing calls this directly
no test coverage detected