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

Function TestIsValidCodeBlockMarker

pkg/workflow/xml_comments_test.go:755–783  ·  view source on GitHub ↗

TestIsValidCodeBlockMarker tests the validation of code block markers

(t *testing.T)

Source from the content-addressed store, hash-verified

753
754// TestIsValidCodeBlockMarker tests the validation of code block markers
755func TestIsValidCodeBlockMarker(t *testing.T) {
756 tests := []struct {
757 name string
758 input string
759 expected bool
760 }{
761 {"Three backticks", "```", true},
762 {"Four backticks", "````", true},
763 {"Three tildes", "~~~", true},
764 {"Five tildes", "~~~~~", true},
765 {"Backticks with language", "```python", true},
766 {"Tildes with language", "~~~bash", true},
767 {"Two backticks", "``", false},
768 {"One backtick", "`", false},
769 {"Two tildes", "~~", false},
770 {"Regular text", "text", false},
771 {"Empty string", "", false},
772 {"Mixed markers", "``~", false},
773 }
774
775 for _, tt := range tests {
776 t.Run(tt.name, func(t *testing.T) {
777 result := isValidCodeBlockMarker(tt.input)
778 if result != tt.expected {
779 t.Errorf("isValidCodeBlockMarker(%q) = %v, want %v", tt.input, result, tt.expected)
780 }
781 })
782 }
783}
784
785// TestIsMatchingCodeBlockMarker tests the matching of closing markers
786func TestIsMatchingCodeBlockMarker(t *testing.T) {

Callers

nothing calls this directly

Calls 3

isValidCodeBlockMarkerFunction · 0.85
RunMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected