Open
Conversation
This ensures that contracts using system.print won't break,
and that there is some mechanism for outputting to the logs
and STDOUT. Test suites which wish to avoid this can stub
system.print, e.g.
system.print = function(msg)
end
or
function stubPrint()
system.origPrint = system.print
system.print = function(msg)
printOutput[#printOutput + 1] = msg
-- We don't have the table library
-- table.insert(printOutput, msg)
end
end
function showPrintOutput()
system.origPrint("captured:")
for i, line in pairs(printOutput) do
system.origPrint(line)
end
system.origPrint("--------")
end
function assertOutputContains(pattern)
for i, line in pairs(printOutput) do
if string.match(line, pattern) then
return true
end
end
error("Output did not contain '" .. pattern .. "'")
end
function resetOutputCapture()
printOutput = {}
end
Codecov Report
@@ Coverage Diff @@
## develop #9 +/- ##
=============================================
- Coverage 71.82% 71.75% -0.08%
Complexity 2 2
=============================================
Files 98 98
Lines 2080 2085 +5
Branches 107 107
=============================================
+ Hits 1494 1496 +2
- Misses 510 513 +3
Partials 76 76
Continue to review full report at Codecov.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This ensures that contracts using system.print won't break,
and that there is some mechanism for outputting to the logs
and STDOUT. Test suites which wish to avoid this can stub
system.print, e.g.
or