aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/email/parser_test.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-11-17 20:43:47 +0100
committerDmitry Vyukov <dvyukov@google.com>2017-11-17 20:43:47 +0100
commita1469efbdd141a26696fdef392334dc337b4d924 (patch)
treedc5ba3edfa0cef66ce34aefa3790b4526047bcdc /pkg/email/parser_test.go
parent00f6ff581c6a4296baf3271e9114cc3a18da93e6 (diff)
pkg/email: unsplit arguments for test command
Diffstat (limited to 'pkg/email/parser_test.go')
-rw-r--r--pkg/email/parser_test.go66
1 files changed, 65 insertions, 1 deletions
diff --git a/pkg/email/parser_test.go b/pkg/email/parser_test.go
index ab5fad631..e4e79e253 100644
--- a/pkg/email/parser_test.go
+++ b/pkg/email/parser_test.go
@@ -10,7 +10,6 @@ import (
"testing"
)
-//!!! add tests with \r\n
func TestExtractCommand(t *testing.T) {
for i, test := range extractCommandTests {
t.Run(fmt.Sprint(i), func(t *testing.T) {
@@ -142,6 +141,71 @@ line 2
cmd: "",
args: "",
},
+ // This is unfortunate case when a command is split by email client
+ // due to 80-column limitation.
+ {
+ body: `
+#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git
+locking/core
+`,
+ cmd: "test:",
+ args: "git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git locking/core",
+ },
+ {
+ body: `
+#syz test:
+git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git locking/core
+`,
+ cmd: "test:",
+ args: "git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git locking/core",
+ },
+ {
+ body: `
+#syz test:
+git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git
+locking/core
+locking/core
+`,
+ cmd: "test:",
+ args: "git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git locking/core",
+ },
+ {
+ body: `
+#syz test_5_arg_cmd arg1
+
+ arg2 arg3
+
+arg4
+arg5
+`,
+ cmd: "test_5_arg_cmd",
+ args: "arg1 arg2 arg3 arg4 arg5",
+ },
+ {
+ body: `
+#syz test_5_arg_cmd arg1
+arg2`,
+ cmd: "test_5_arg_cmd",
+ args: "arg1 arg2",
+ },
+ {
+ body: `
+#syz test_5_arg_cmd arg1
+arg2
+`,
+ cmd: "test_5_arg_cmd",
+ args: "arg1 arg2",
+ },
+ {
+ body: `
+#syz test_5_arg_cmd arg1
+arg2
+
+
+`,
+ cmd: "test_5_arg_cmd",
+ args: "arg1 arg2",
+ },
}
type ParseTest struct {