Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions src/pkg/rfcnotify/card_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -535,3 +535,46 @@ func TestCard_BotAuthorOmitsIconURL(t *testing.T) {
t.Errorf("IconURL = %q, want empty for [bot] login", card.Author.IconURL)
}
}

func TestIsRelatedKey(t *testing.T) {
tests := []struct {
key string
want bool
}{
{"builds on", true},
{"supersedes", true},
{"related", true},
{"related rfcs", true},
{"related rfc", true},
{"related-anything", true},
{"status", false},
{"target", false},
{"field", false},
{"", false},
}
for _, tt := range tests {
if got := isRelatedKey(tt.key); got != tt.want {
t.Errorf("isRelatedKey(%q) = %v, want %v", tt.key, got, tt.want)
}
}
}

func TestIsTableHeaderOrSeparator(t *testing.T) {
tests := []struct {
key, val string
want bool
}{
{"field", "value", true},
{"key", "value", true},
{"---", "value", true},
{"normal", "---", true},
{"normal", "value", false},
{"target", "text", false},
{"status", "active", false},
}
for _, tt := range tests {
if got := isTableHeaderOrSeparator(tt.key, tt.val); got != tt.want {
t.Errorf("isTableHeaderOrSeparator(%q, %q) = %v, want %v", tt.key, tt.val, got, tt.want)
}
}
}
Loading