Change in the prefix of messages from searchers

The initial "\n\t" to properly indent a searcher message is being added
by 'findloader' when building the error message, instead of being
included in the original message by each searcher itself.
This commit is contained in:
Roberto Ierusalimschy
2019-10-24 10:49:44 -03:00
parent b93f3b00bb
commit ba9cd0d25a
2 changed files with 32 additions and 5 deletions

View File

@@ -47,6 +47,29 @@ do
package.path = oldpath
end
do print"testing 'require' message"
local oldpath = package.path
local oldcpath = package.cpath
package.path = "?.lua;?/?"
package.cpath = "?.so;?/init"
local st, msg = pcall(require, 'XXX')
local expected = [[module 'XXX' not found:
no field package.preload['XXX']
no file 'XXX.lua'
no file 'XXX/XXX'
no file 'XXX.so'
no file 'XXX/init']]
assert(msg == expected)
package.path = oldpath
package.cpath = oldcpath
end
print('+')