-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should not sleep Fixes #356
Open
Cyberboss
wants to merge
21
commits into
SpaceManiac:master
Choose a base branch
from
Cyberboss:ShouldNotSleepFixes
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 7 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
0471800
Don't panic when there are still expected errors but no additional er…
Cyberboss 109ae64
Split sleep tests and pure tests
Cyberboss 3d15d6a
Remove unnecessary pub's
Cyberboss 0415643
Output test errors when finding more than expected
Cyberboss 23693c7
Fix ProcRef.recurse_children ignoring children in different typepaths
Cyberboss 6a14a25
Walk proc overrides when checking should not sleep.
Cyberboss dc54c72
Improvements
Cyberboss ca20006
Optimization
Cyberboss ebc661c
Asd says this box is unnecessary
Cyberboss 3a60844
Fix a typo
Cyberboss e554514
Remove this .clone()
Cyberboss 3429a01
Final optimizations
Cyberboss c5667bf
Fix tests
Cyberboss 505a52c
Remove unnecessary instrumenting
Cyberboss da085a7
Add missing docs for ALLOWED_TO_SLEEP
Cyberboss c6d4ba5
Do not recurse child procs when checking /New()
Cyberboss b9a0314
Fix sleep_tests (previous behavior was incorrect)
Cyberboss f19545a
For this error to make sense, the builtin should come _after_ the cal…
Cyberboss 569cfc4
Merge branch 'master' of https://github.com/SpaceManiac/SpacemanDMM i…
Cyberboss e934dac
Failing test: Walking incorrect type tree
Cyberboss 92cc07f
Fixing this test may not be possible actually
Cyberboss File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,48 @@ | ||
extern crate dreamchecker as dc; | ||
|
||
use dc::test_helpers::check_errors_match; | ||
|
||
const PURE_ERRORS: &[(u32, u16, &str)] = &[ | ||
(12, 16, "/mob/proc/test2 sets SpacemanDMM_should_be_pure but calls a /proc/impure that does impure operations"), | ||
]; | ||
|
||
#[test] | ||
fn pure() { | ||
let code = r##" | ||
/proc/pure() | ||
return 1 | ||
/proc/impure() | ||
world << "foo" | ||
/proc/foo() | ||
pure() | ||
/proc/bar() | ||
impure() | ||
/mob/proc/test() | ||
set SpacemanDMM_should_be_pure = TRUE | ||
return foo() | ||
/mob/proc/test2() | ||
set SpacemanDMM_should_be_pure = TRUE | ||
bar() | ||
"##.trim(); | ||
check_errors_match(code, PURE_ERRORS); | ||
} | ||
|
||
// these tests are separate because the ordering the errors are reported in isn't determinate and I CBF figuring out why -spookydonut Jan 2020 | ||
// TODO: find out why | ||
const PURE2_ERRORS: &[(u32, u16, &str)] = &[ | ||
(5, 5, "call to pure proc test discards return value"), | ||
]; | ||
|
||
#[test] | ||
fn pure2() { | ||
let code = r##" | ||
/mob/proc/test() | ||
set SpacemanDMM_should_be_pure = TRUE | ||
return 1 | ||
/mob/proc/test2() | ||
test() | ||
/mob/proc/test3() | ||
return test() | ||
"##.trim(); | ||
check_errors_match(code, PURE2_ERRORS); | ||
} |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way this was implemented wasn't effective and the cause of the misses because it didn't catch overrides that called that called procs that slept.