From 7164b97a5d0e28ed11152ff6a3f1b62b7243e28a Mon Sep 17 00:00:00 2001 From: Alex Thiessen Date: Thu, 26 May 2022 19:54:00 +0200 Subject: [PATCH] test/assert_regex.bats: Add multi-line pattern test --- test/assert_regex.bats | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/assert_regex.bats b/test/assert_regex.bats index 3d5ee40..3f67d5b 100644 --- a/test/assert_regex.bats +++ b/test/assert_regex.bats @@ -51,6 +51,17 @@ pattern (1 lines): ERR_MSG } +@test "assert_regex() : newlines in the match newlines in the " { + run assert_regex $'one\ntwo' $'e\nt' + assert_test_pass + + run assert_regex $'one\ntwo' $'\nt' + assert_test_pass + + run assert_regex $'one\ntwo\n' $'o\n' + assert_test_pass +} + # Error handling @test "assert_regex() : returns 1 and displays an error message if is not a valid extended regular expression" { run assert_regex value '[.*'