aboutsummaryrefslogtreecommitdiffstats
path: root/executor/style_test.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2020-09-28 10:04:56 +0200
committerDmitry Vyukov <dvyukov@google.com>2020-09-28 12:21:40 +0200
commiteea5f51ff6a3382debe76e65a7eb194baf2930bd (patch)
tree3ad58e410e1c0a8e4bf228aebe6bf5f7fb23b0ca /executor/style_test.go
parent38c78d5c07a1296817ae0ac9b895ee62cf691ce2 (diff)
executor: check for \n in fail/exitf messages
Diffstat (limited to 'executor/style_test.go')
-rw-r--r--executor/style_test.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/executor/style_test.go b/executor/style_test.go
index f6f5856f3..3b0ee8ce7 100644
--- a/executor/style_test.go
+++ b/executor/style_test.go
@@ -110,6 +110,13 @@ if (foo)
`,
},
},
+ {
+ pattern: `\s*(fail|exitf)\(".*\\n`,
+ message: "Don't use \\n in fail/exitf messages",
+ tests: []string{
+ `fail("some message with new line\n");`,
+ },
+ },
}
for _, check := range checks {
re := regexp.MustCompile(check.pattern)