-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(globalpatches) better rbusted support
- do not patch math.randomseed() in rbusted (we run in a timer contect, so we naver have a chance to seed in init_worker, hence, we never have a chance to seed at all if we ever need to) - add a patch for Luassert's `assert` occasionaly annoying arithmetic error in case of assertion failure
- Loading branch information
1 parent
82d6715
commit db71aa5
Showing
3 changed files
with
86 additions
and
41 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
describe("globalpatches", function() | ||
describe("assert", function() | ||
it("does not errors zhen arg #3 is not a number", function() | ||
-- if not patched, this would throw: | ||
-- luassert/assert.lua:155: attempt to perform arithmetic on a string value | ||
assert.error_matches(function() | ||
assert(false, "some error", "some return value") | ||
end, "some error", nil, true) | ||
end) | ||
end) | ||
end) |