@@ -16,7 +16,7 @@ func TestIncidentCardCommentWorkflow(t *testing.T) {
1616 }
1717
1818 body := string (card )
19- quotedHeredoc := "COMMENT=$(cat <<'COMMENT_EOF '"
19+ quotedHeredoc := "COMMENT=$(cat <<'FDUTY_COMMENT_7F3A9C2E_EOF '"
2020 commentCommand := `fduty incident comment "$ID" --comment "$COMMENT"`
2121 timelineCommand := `fduty incident timeline "$ID" --output-format toon`
2222
@@ -36,6 +36,9 @@ func TestIncidentCardCommentWorkflow(t *testing.T) {
3636 if ! strings .Contains (body , "After every comment write, read back every target and verify the intended comment is present before reporting success." ) {
3737 t .Error ("incident card must require content-fidelity verification after every comment write" )
3838 }
39+ if ! strings .Contains (body , "choose a fresh delimiter that is absent as a full line in the intended comment" ) {
40+ t .Error ("incident card must require a collision-free heredoc delimiter" )
41+ }
3942 if strings .Contains (body , `fduty incident comment <incident-id> --comment "Root cause identified: DB failover. Fix deploying."` ) {
4043 t .Error ("incident card must not retain the unsafe inline comment example" )
4144 }
@@ -51,11 +54,12 @@ func TestIncidentCommentQuotedHeredocPreservesMarkdown(t *testing.T) {
5154}
5255
5356ID=64b64ca26f84f00000000000
54- COMMENT=$(cat <<'COMMENT_EOF '
57+ COMMENT=$(cat <<'FDUTY_COMMENT_7F3A9C2E_EOF '
5558## Investigation
5659Use ` + "`kubectl get pod`" + ` to inspect the restart.
57- The follow-up is still pending.
5860COMMENT_EOF
61+ The follow-up is still pending.
62+ FDUTY_COMMENT_7F3A9C2E_EOF
5963)
6064fduty incident comment "$ID" --comment "$COMMENT"
6165`
@@ -65,7 +69,7 @@ fduty incident comment "$ID" --comment "$COMMENT"
6569 t .Fatalf ("Bash fixture failed: %v\n %s" , err , output )
6670 }
6771
68- want := "## Investigation\n Use `kubectl get pod` to inspect the restart.\n The follow-up is still pending."
72+ want := "## Investigation\n Use `kubectl get pod` to inspect the restart.\n COMMENT_EOF \ n The follow-up is still pending."
6973 if got := string (output ); got != want {
7074 t .Errorf ("comment content changed:\n want: %q\n got: %q" , want , got )
7175 }
0 commit comments