Tarantool development patches archive
 help / color / mirror / Atom feed
From: Igor Munkin via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Sergey Kaplun <skaplun@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: [Tarantool-patches] [PATCH luajit] test: adjust lua-Harness test error assertion
Date: Tue, 19 Dec 2023 16:27:06 +0000	[thread overview]
Message-ID: <476e84bb2045ab5878ae66bb9aab9bd856ca274c.1703001072.git.imun@tarantool.org> (raw)

The current pattern in 303-package.t for the test case loading invalid
Lua script is too tight for the following reasons revealed by Tarantool
* The platform might prepend the common prefix to all Lua errors, so
  anchoring the pattern to the beginning of the error message is too
  strict for matching the particular errors.
* The platform might canonicalize module names (i.e., use absolute
  paths) for searchers and loaders, so matching the current working
  directory via "./" is too straight-forward.

Hence, this patch removes the starting anchor from the pattern and fixes
the last part of it to match only the "basename" of the module being
loaded. As a result, the check is not too strict and Lua-specific but
rather starts following common sense.

Signed-off-by: Igor Munkin <imun@tarantool.org>

Branch: https://github.com/tarantool/luajit/tree/imun/fix-test-for-tarantool-searchers
PR: https://github.com/tarantool/tarantool/pull/9511

Integration CI is red due to exercises with automatic submodule bumps.
Testing in PR represents the integration part.

 test/lua-Harness-tests/303-package.t | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/lua-Harness-tests/303-package.t b/test/lua-Harness-tests/303-package.t
index ccd7c510..b5b3d9ea 100755
--- a/test/lua-Harness-tests/303-package.t
+++ b/test/lua-Harness-tests/303-package.t
@@ -199,7 +199,7 @@ return complex
     f:write [[?syntax error?]]
     error_matches(function () require('syntax') end,
-            "^error loading module 'syntax' from file '%.[/\\]syntax%.lua':",
+            "error loading module 'syntax' from file '.+[/\\]syntax%.lua':",
             "function require (syntax error)")
     os.remove('syntax.lua') -- clean up

             reply	other threads:[~2023-12-19 16:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-19 16:27 Igor Munkin via Tarantool-patches [this message]
2023-12-20  6:21 ` Sergey Kaplun via Tarantool-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=476e84bb2045ab5878ae66bb9aab9bd856ca274c.1703001072.git.imun@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=imun@tarantool.org \
    --cc=skaplun@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH luajit] test: adjust lua-Harness test error assertion' \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox