Module:ScribuntoUnit/sandbox: Difference between revisions

Content deleted Content added
test using nowiki for display string of assertStringContains, don't truncate the display string as it makes debugging harder
nowiki the patterns as well, and also nowiki the match in assertNotStringContains
Line 140:
end
if not mw.ustring.find(s, pattern, nil, plain) then
local displaydisplayPattern, displayString
if self.frame then
displaydisplayPattern = mw.text.nowiki(spattern)
displayString = mw.text.nowiki(s)
else
displaydisplayPattern = spattern
displayString = s
end
DebugHelper.raise({
ScribuntoUnit = true,
text = mw.ustring.format('Failed to find %s "%s" in string "%s"', plain and "plain string" or "pattern", patterndisplayPattern, displaydisplayString),
message = message
}, 2)
Line 177 ⟶ 179:
if i then
local match = mw.ustring.sub(s, i, j)
local displayMatch, displayPattern
if self.frame then
displayMatch = mw.text.nowiki(match)
displayPattern = mw.text.nowiki(pattern)
else
displayMatch = match
displayPattern = pattern
end
DebugHelper.raise({
ScribuntoUnit = true,
text = mw.ustring.format('Found match "%s" for %s "%s"', matchdisplayMatch, plain and "plain string" or "pattern", patterndisplayPattern),
message = message
}, 2)