From eea5f51ff6a3382debe76e65a7eb194baf2930bd Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 28 Sep 2020 10:04:56 +0200 Subject: executor: check for \n in fail/exitf messages --- executor/style_test.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'executor/style_test.go') 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) -- cgit mrf-deployment