summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Gerus <rgerus@dpd.com.pl>2015-12-22 11:33:13 +0100
committerRobert Gerus <rgerus@dpd.com.pl>2015-12-22 11:33:13 +0100
commite577b1adb07529e79b244451d84b9e04321d3ffd (patch)
treef3e6f60e1a9ba1b6ca3e8ea04205711e2a7e6bc7
parent7d16d62b0c02f8abdb72f52cc73a2e5c8978a0dc (diff)
downloadgorepost-e577b1adb07529e79b244451d84b9e04321d3ffd.tar.gz
gorepost-e577b1adb07529e79b244451d84b9e04321d3ffd.tar.bz2
gorepost-e577b1adb07529e79b244451d84b9e04321d3ffd.tar.xz
gorepost-e577b1adb07529e79b244451d84b9e04321d3ffd.zip
Add tests for the new and improved linktitle.
-rw-r--r--bot/plugins_test.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/bot/plugins_test.go b/bot/plugins_test.go
index 5b68922..d20602a 100644
--- a/bot/plugins_test.go
+++ b/bot/plugins_test.go
@@ -809,6 +809,30 @@ var variableOutputTestEvents = []struct {
outRegex: *regexp.MustCompile("^at:"),
function: at,
},
+ {
+ in: irc.Message{
+ Command: "PRIVMSG",
+ Trailing: "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
+ Params: []string{"#testchan-1"},
+ Prefix: &irc.Prefix{
+ Name: "idontexist",
+ },
+ },
+ outRegex: *regexp.MustCompile("^↳ title: Rick Astley - Never Gonna Give You Up"),
+ function: linktitle,
+ },
+ {
+ in: irc.Message{
+ Command: "PRIVMSG",
+ Trailing: "http://youtu.be/dQw4w9WgXcQ",
+ Params: []string{"#testchan-1"},
+ Prefix: &irc.Prefix{
+ Name: "idontexist",
+ },
+ },
+ outRegex: *regexp.MustCompile("^↳ title: Rick Astley - Never Gonna Give You Up"),
+ function: linktitle,
+ },
}
func TestFunctionsWithVariableOutput(t *testing.T) {