(t *testing.T)
| 326 | } |
| 327 | |
| 328 | func TestCheckWorkflowFileStatusNotInRepo(t *testing.T) { |
| 329 | tmpDir := testutil.TempDir(t, "test-*") |
| 330 | |
| 331 | originalDir, err := os.Getwd() |
| 332 | require.NoError(t, err, "get current directory for test setup") |
| 333 | defer func() { |
| 334 | _ = os.Chdir(originalDir) |
| 335 | }() |
| 336 | |
| 337 | require.NoError(t, os.Chdir(tmpDir), "change to temp directory for test setup") |
| 338 | |
| 339 | // Don't initialize git - should return empty status without error |
| 340 | status, err := checkWorkflowFileStatus("test.md") |
| 341 | require.NoError(t, err, "get workflow file status outside a git repository") |
| 342 | assert.False(t, status.IsModified, "non-git directory should not report a modified workflow file") |
| 343 | assert.False(t, status.IsStaged, "non-git directory should not report a staged workflow file") |
| 344 | assert.False(t, status.HasUnpushedCommits, "non-git directory should not report unpushed commits") |
| 345 | } |
| 346 | |
| 347 | func TestExtractHostFromRemoteURL(t *testing.T) { |
| 348 | tests := []struct { |
nothing calls this directly
no test coverage detected