package release import "testing" func TestVersionInTitle(t *testing.T) { for title, want := range map[string]string{ // My Chemical Romance's groups MusicBrainz types as plain Singles (#5573). "Common People (Recorded For BBC Radio 1)": "Live", "Welcome to the Black Parade (Steve Aoki remix)": "Remix", "The Five of Us Are Dying (Rough mix)": "Demo", "I'm Not Okay (I Promise) [outtake version 2]": "Demo", "Na Na Na (live from Sessions@AOL)": "Live", "Song - Live at Wembley": "Live", "Song – Club Mix": "Remix", "Helena (Acoustic)": "", "Teenagers (a cappella)": "", "Hybrid Theory (20th Anniversary Edition)": "none", "Live Through This": "none", "Live Forever": "none", "The Black Parade": "none", "Warped Tour ’05: Bootleg Series (live at Warped Tour": "Live", // unclosed } { v, ok := VersionInTitle(title) got := v.Typ if !ok { got = "none" } if got != want { t.Errorf("VersionInTitle(%q) = %q (%q), want %q", title, got, v.Word, want) } } }