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

Function TestActionModeValidation

pkg/workflow/compiler_custom_actions_test.go:15–35  ·  view source on GitHub ↗

TestActionModeValidation tests the ActionMode type validation

(t *testing.T)

Source from the content-addressed store, hash-verified

13
14// TestActionModeValidation tests the ActionMode type validation
15func TestActionModeValidation(t *testing.T) {
16 tests := []struct {
17 mode ActionMode
18 valid bool
19 }{
20 {ActionModeDev, true},
21 {ActionModeRelease, true},
22 {ActionModeScript, true},
23 {ActionModeAction, true},
24 {ActionMode("invalid"), false},
25 {ActionMode(""), false},
26 }
27
28 for _, tt := range tests {
29 t.Run(string(tt.mode), func(t *testing.T) {
30 if got := tt.mode.IsValid(); got != tt.valid {
31 t.Errorf("ActionMode(%q).IsValid() = %v, want %v", tt.mode, got, tt.valid)
32 }
33 })
34 }
35}
36
37// TestActionModeString tests the String() method
38func TestActionModeString(t *testing.T) {

Callers

nothing calls this directly

Calls 4

ActionModeTypeAlias · 0.85
RunMethod · 0.45
IsValidMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected