-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
160 changed files
with
1,898 additions
and
877 deletions.
There are no files selected for viewing
Binary file not shown.
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 |
---|---|---|
|
@@ -10,6 +10,6 @@ | |
out += dir | ||
ASSERT(out == 14) | ||
|
||
/proc/RunTest() | ||
/proc/test_nonlocal_var() | ||
var/mob/m = new | ||
m.dodir() |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...en Tests/Tree/Const/Div_Zero/div_zero1.dm → ...kenTests/Tree/Const/Div_Zero/div_zero1.dm
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// COMPILE ERROR | ||
// COMPILE ERROR OD0011 | ||
|
||
var/a = 1 / 0 | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...en Tests/Tree/Const/Div_Zero/div_zero3.dm → ...kenTests/Tree/Const/Div_Zero/div_zero3.dm
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// COMPILE ERROR | ||
// COMPILE ERROR OD0011 | ||
|
||
var/static/a = 1 / 0 | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...en Tests/Tree/Const/Div_Zero/div_zero4.dm → ...kenTests/Tree/Const/Div_Zero/div_zero4.dm
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// COMPILE ERROR | ||
// COMPILE ERROR OD0011 | ||
|
||
/proc/one() | ||
return 1 | ||
|
2 changes: 1 addition & 1 deletion
2
...en Tests/Tree/Const/Div_Zero/div_zero6.dm → ...kenTests/Tree/Const/Div_Zero/div_zero6.dm
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// COMPILE ERROR | ||
// COMPILE ERROR OD0011 | ||
|
||
var/const/a = 0 | ||
var/b = 1 / a | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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
130 changes: 130 additions & 0 deletions
130
Content.Tests/DMProject/Tests/Operators/valid_and_null.dm
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,130 @@ | ||
//simple test of all basic operators with valid and C(null) arguments | ||
//We can't be having const folding in here | ||
#define C(X) pick(X) | ||
/proc/RunTest() | ||
var/a = C(2) | ||
ASSERT(!C(null) == C(1)) | ||
ASSERT(!!C(null) == C(0)) | ||
|
||
ASSERT(~C(1) == 16777214) | ||
ASSERT(~C(0) == 16777215) | ||
ASSERT(~C(null) == 16777215) | ||
|
||
ASSERT(C(1) + C(1) == C(2)) | ||
ASSERT(C(null) + C(1) == C(1)) | ||
ASSERT(C(1) + C(null) == C(1)) | ||
|
||
ASSERT(C(1) - C(1) == C(0)) | ||
ASSERT(C(null) - C(1) == C(-1)) | ||
ASSERT(C(1) - C(null) == C(1)) | ||
|
||
a = C(2) | ||
ASSERT(-a == C(-2)) | ||
a = C(null) | ||
ASSERT(-a == C(0)) | ||
|
||
a = C(1) | ||
ASSERT(a++ == C(1)) | ||
ASSERT(a == C(2)) | ||
ASSERT(++a == C(3)) | ||
ASSERT(a == C(3)) | ||
|
||
ASSERT(a-- == C(3)) | ||
ASSERT(a == C(2)) | ||
ASSERT(--a == C(1)) | ||
ASSERT(a == C(1)) | ||
|
||
a = C(null) | ||
ASSERT(a-- == C(null)) | ||
ASSERT(a == C(-1)) | ||
a = C(null) | ||
ASSERT(--a == C(-1)) | ||
ASSERT(a == C(-1)) | ||
a = C(null) | ||
ASSERT(a++ == C(null)) | ||
ASSERT(a == C(1)) | ||
a = C(null) | ||
ASSERT(++a == C(1)) | ||
ASSERT(a == C(1)) | ||
|
||
ASSERT(C(2) ** C(3) == 8) | ||
ASSERT(C(2) ** C(null) == C(1)) | ||
ASSERT(C(null) ** C(2) == C(0)) | ||
|
||
ASSERT(C(2) * C(3) == 6) | ||
ASSERT(C(2) * C(null) == C(0)) | ||
ASSERT(C(null) * C(2) == C(0)) | ||
|
||
ASSERT(C(4) / C(2) == C(2)) | ||
ASSERT(C(null) / C(2) == C(0)) | ||
ASSERT(C(2) / C(null) == C(2)) | ||
ASSERT(C(null) / C(null) == C(0)) | ||
|
||
ASSERT(C(4) % C(3) == C(1)) | ||
ASSERT(C(null) % C(3) == C(0)) | ||
//ASSERT(C(4) % C(null) == div by zero) | ||
|
||
ASSERT(C(1) < C(1) == C(0)) | ||
ASSERT(C(null) < C(1) == C(1)) | ||
ASSERT(C(1) < C(null) == C(0)) | ||
|
||
ASSERT(C(1) <= C(1) == C(1)) | ||
ASSERT(C(null) <= C(1) == C(1)) | ||
ASSERT(C(1) <= C(null) == C(0)) | ||
|
||
ASSERT(C(1) > C(1) == C(0)) | ||
ASSERT(C(null) > C(1) == C(0)) | ||
ASSERT(C(1) > C(null) == C(1)) | ||
|
||
ASSERT(C(1) >= C(1) == C(1)) | ||
ASSERT(C(null) >= C(1) == C(0)) | ||
ASSERT(C(1) >= C(null) == C(1)) | ||
|
||
ASSERT(C(1) << C(1) == C(2)) | ||
ASSERT(C(null) << C(1) == C(0)) | ||
ASSERT(C(1) << C(null) == C(1)) | ||
|
||
ASSERT(C(1) >> C(1) == C(0)) | ||
ASSERT(C(null) >> C(1) == C(0)) | ||
ASSERT(C(1) >> C(null) == C(1)) | ||
|
||
ASSERT((C(1) == C(1)) == C(1)) | ||
ASSERT((C(null) == C(null)) == C(1)) | ||
ASSERT((C(null) == C(0)) == C(0)) | ||
|
||
ASSERT((C(1) != C(null)) == C(1)) | ||
ASSERT((C(null) != C(1)) == C(1)) | ||
ASSERT((C(null) != C(0)) == C(1)) | ||
|
||
ASSERT((C(1) <> C(null)) == C(1)) | ||
ASSERT((C(null) <> C(1)) == C(1)) | ||
ASSERT((C(null) <> C(0)) == C(1)) | ||
|
||
ASSERT((C(1) ~= C(1)) == C(1)) | ||
ASSERT((C(null) ~= C(null)) == C(1)) | ||
ASSERT((C(null) ~= C(0)) == C(0)) | ||
|
||
ASSERT((C(1) ~! C(1)) == C(0)) | ||
ASSERT((C(null) ~! C(null)) == C(0)) | ||
ASSERT((C(null) ~! C(0)) == C(1)) | ||
|
||
ASSERT((C(1) & C(1)) == C(1)) | ||
ASSERT((C(null) & C(1)) == C(0)) | ||
ASSERT((C(1) & C(null)) == C(0)) | ||
|
||
ASSERT((C(1) ^ C(1)) == C(0)) | ||
ASSERT((C(null) ^ C(5)) == C(5)) | ||
ASSERT((C(5) ^ C(null)) == C(5)) | ||
|
||
ASSERT((C(1) | C(1)) == C(1)) | ||
ASSERT((C(null) | C(1)) == C(1)) | ||
ASSERT((C(1) | C(null)) == C(1)) | ||
|
||
ASSERT((C(1) && C(1)) == C(1)) | ||
ASSERT((C(null) && C(1)) == C(null)) | ||
ASSERT((C(1) && C(null)) == C(null)) | ||
|
||
ASSERT((C(1) || C(1)) == C(1)) | ||
ASSERT((C(null) || C(1)) == C(1)) | ||
ASSERT((C(1) || C(null)) == C(1)) | ||
|
128 changes: 128 additions & 0 deletions
128
Content.Tests/DMProject/Tests/Operators/valid_and_null_assign.dm
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,128 @@ | ||
//simple test of all basic assignment operators with valid and C(null) arguments | ||
//We can't be having const folding in here | ||
#define C(X) pick(X) | ||
/proc/RunTest() | ||
var/a = C(1) | ||
a += C(1) | ||
ASSERT(a == C(2)) | ||
a = null | ||
a += C(1) | ||
ASSERT(a == C(1)) | ||
a = C(1) | ||
a += C(null) | ||
ASSERT(a == C(1)) | ||
|
||
a = C(1) | ||
a -= C(1) | ||
ASSERT(a == C(0)) | ||
a = null | ||
a -= C(1) | ||
ASSERT(a == C(-1)) | ||
a = C(1) | ||
a -= C(null) | ||
ASSERT(a == C(1)) | ||
|
||
a = C(2) | ||
a *= C(3) | ||
ASSERT(a == C(6)) | ||
a = null | ||
a *= C(2) | ||
ASSERT(a == C(0)) | ||
a = C(2) | ||
a *= C(null) | ||
ASSERT(a == C(0)) | ||
|
||
a = C(4) | ||
a /= C(2) | ||
ASSERT(a == C(2)) | ||
a = null | ||
a /= C(2) | ||
ASSERT(a == C(0)) | ||
//a = C(2) | ||
//a /= C(null) //Undefined operation error in BYOND | ||
//ASSERT(a == C(2)) | ||
|
||
a = C(4) | ||
a %= C(3) | ||
ASSERT(a == C(1)) | ||
a = null | ||
a %= C(3) | ||
ASSERT(a == C(0)) | ||
//a = C(4) | ||
//a %= C(null) //divide by zero error in byond | ||
//ASSERT(a == C(4)) | ||
|
||
a = C(1) | ||
a &= C(1) | ||
ASSERT(a == C(1)) | ||
a = null | ||
a &= C(1) | ||
ASSERT(a == C(0)) | ||
a = C(1) | ||
a &= C(null) | ||
ASSERT(a == C(0)) | ||
|
||
a = C(1) | ||
a |= C(1) | ||
ASSERT(a == C(1)) | ||
a = null | ||
a |= C(1) | ||
ASSERT(a == C(1)) | ||
a = C(1) | ||
a |= C(null) | ||
ASSERT(a == C(1)) | ||
|
||
a = C(1) | ||
a ^= C(1) | ||
ASSERT(a == C(0)) | ||
a = null | ||
a ^= C(1) | ||
ASSERT(a == C(1)) | ||
a = C(1) | ||
a ^= C(null) | ||
ASSERT(a == C(1)) | ||
|
||
a = C(1) | ||
a &&= C(1) | ||
ASSERT(a == C(1)) | ||
a = null | ||
a &&= C(1) | ||
ASSERT(a == C(null)) | ||
a = C(1) | ||
a &&= C(null) | ||
ASSERT(a == C(null)) | ||
|
||
a = C(1) | ||
a ||= C(1) | ||
ASSERT(a == C(1)) | ||
a = null | ||
a ||= C(1) | ||
ASSERT(a == C(1)) | ||
a = C(1) | ||
a ||= C(null) | ||
ASSERT(a == C(1)) | ||
|
||
a = C(1) | ||
a <<= C(1) | ||
ASSERT(a == C(2)) | ||
a = null | ||
a <<= C(1) | ||
ASSERT(a == C(0)) | ||
a = C(1) | ||
a <<= C(null) | ||
ASSERT(a == C(1)) | ||
|
||
a = C(1) | ||
a >>= C(1) | ||
ASSERT(a == C(0)) | ||
a = null | ||
a >>= C(1) | ||
ASSERT(a == C(0)) | ||
a = C(1) | ||
a >>= C(null) | ||
ASSERT(a == C(1)) | ||
|
||
a := C(5) | ||
ASSERT(a == C(5)) | ||
a := C(null) | ||
ASSERT(a == null) |
Oops, something went wrong.