-
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.
Merge remote-tracking branch 'upstream/master' into 1262-SmartYield
- Loading branch information
Showing
147 changed files
with
4,868 additions
and
4,939 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,8 @@ | ||
/proc/RunTest() | ||
var/obj/obj1 = new() | ||
var/obj/obj2 = new() | ||
var/list/things = list(obj1,"beep","thing","stuff") | ||
var/A = locate(ref(obj1)) in things | ||
ASSERT(A == obj1) | ||
var/B = locate(ref(obj2)) in things | ||
ASSERT(isnull(B)) |
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,7 @@ | ||
|
||
|
||
/datum/test/var/bar = "foobar" | ||
/proc/RunTest() | ||
var/datum/test/D = __IMPLIED_TYPE__ | ||
ASSERT(D.bar == "foobar") | ||
|
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,29 @@ | ||
/proc/RunTest() | ||
ASSERT(text2ascii_char("abcdéfg",6) == 102) //102 is f | ||
ASSERT(ascii2text(text2ascii("a")) == "a") | ||
var/list/values = list( | ||
"©" = 0x00A9, | ||
"®" = 0x00AE, | ||
"‼" = 0x203C, | ||
"⁉" = 0x2049, | ||
"⃣" = 0x20E3, | ||
"™" = 0x2122, | ||
"ℹ" = 0x2139, | ||
"⌚" = 0x231A, | ||
"⌛" = 0x231B, | ||
"⌨" = 0x2328, | ||
"⏏" = 0x23CF, | ||
"Ⓜ" = 0x24C2, | ||
"▪" = 0x25AA, | ||
"▫" = 0x25AB, | ||
"▶" = 0x25B6, | ||
"◀" = 0x25C0, | ||
"⤴" = 0x2934, | ||
"⤵" = 0x2935, | ||
"〰" = 0x3030, | ||
"〽" = 0x303D, | ||
"㊗" = 0x3297, | ||
"㊙" = 0x3299, | ||
) | ||
for(var/v in values) | ||
ASSERT(ascii2text(values[v]) == v) |
This file was deleted.
Oops, something went wrong.
11 changes: 11 additions & 0 deletions
11
Content.Tests/DMProject/Tests/Call/LateralPointlessOverride.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,11 @@ | ||
#pragma PointlessParentCall error | ||
|
||
// don't emit the pragma if lateral overrides exist | ||
/datum/foo() | ||
return | ||
/datum/proc/foo() | ||
..() | ||
return | ||
|
||
/proc/RunTest() | ||
return |
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,9 @@ | ||
// COMPILE ERROR | ||
#pragma PointlessParentCall error | ||
|
||
/datum/proc/foo() | ||
..() | ||
return | ||
|
||
/proc/RunTest() | ||
return |
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,5 @@ | ||
|
||
/datum/var/bar = "foobar" | ||
/proc/RunTest() | ||
var/datum/D = /datum | ||
ASSERT(D.bar == "foobar") |
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,14 @@ | ||
/image/subclass | ||
plane = 123 | ||
icon_state = "subclass" | ||
|
||
/proc/RunTest() | ||
var/image/test = new /image/subclass | ||
ASSERT(test.plane == 123) | ||
ASSERT(test.icon_state == "subclass") | ||
var/image/subclass/test2 = new(icon()) | ||
ASSERT(test2.plane == FLOAT_PLANE) | ||
ASSERT(test2.icon_state == null) | ||
var/image/subclass/test3 = new(icon_state="test") | ||
ASSERT(test3.plane == 123) | ||
ASSERT(test3.icon_state == "test") |
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,13 @@ | ||
/datum/test | ||
var/normal_var = 123 | ||
var/static/static_var = 321 | ||
/proc/RunTest() | ||
var/datum/test/t = new() | ||
var/varlist = t.vars | ||
ASSERT(length(varlist) == 6) // normal_var, static_var, tag, type, parent_type, vars | ||
ASSERT(varlist["static_var"] == 321) | ||
ASSERT(varlist["normal_var"] == 123) | ||
ASSERT(varlist["type"] == /datum/test) | ||
ASSERT(varlist["parent_type"] == /datum) | ||
ASSERT(("vars" in varlist)) | ||
ASSERT(varlist["vars"] == varlist) |
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,22 @@ | ||
/proc/RunTest() | ||
ASSERT(min(1,2,3) == 1) | ||
ASSERT(min(null, 1) == null) | ||
ASSERT(min(null, -1) == -1) | ||
ASSERT(min(1, null) == null) | ||
ASSERT(min(-1, null) == -1) | ||
ASSERT(min(1, null) == null) | ||
ASSERT(min(0, null) == null) | ||
ASSERT(min(null, 0) == 0) | ||
ASSERT(min("a","b","c")=="a") | ||
ASSERT(min("b","a","c")=="a") | ||
|
||
ASSERT(max(1,2,3) == 3) | ||
ASSERT(max(null, 1) == 1) | ||
ASSERT(max(null, -1) == null) | ||
ASSERT(max(1,null) == 1) | ||
ASSERT(max(-1,null) == null) | ||
ASSERT(max(1, null) == 1) | ||
ASSERT(max(0, null) == null) | ||
ASSERT(max(null, 0) == 0) | ||
ASSERT(max("a","b","c")=="c") | ||
ASSERT(max("b","a","c")=="c") |
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,61 @@ | ||
/datum | ||
var/static/datum/three/three | ||
var/text = "hello" | ||
|
||
var/static/one = "one" | ||
|
||
/datum/three | ||
var/static/datum/four/four | ||
text = "hi" | ||
var/overridden_text = type::text | ||
var/original_text = parent_type::text | ||
|
||
/datum/three/proc/typetest() | ||
// initial shorthand, type:: and parent_type:: | ||
ASSERT(text == "hi") | ||
ASSERT(original_text == "hello") | ||
ASSERT(overridden_text == "hi") | ||
overridden_text = "hi there!" | ||
original_text = "hello there" | ||
text = "hi there" | ||
ASSERT(src::text == "hi") | ||
ASSERT(src::overridden_text == "hi") | ||
ASSERT(src::original_text == "hello") | ||
|
||
// proc reference | ||
ASSERT(__PROC__ == /datum/three::typetest()) | ||
|
||
/datum/four | ||
var/datum/five/five | ||
|
||
/datum/five | ||
var/static/six = "three four five six" | ||
|
||
/proc/return_two() | ||
return "two" | ||
|
||
/proc/RunTest() | ||
// global vars and procs | ||
ASSERT(::one == "one") | ||
ASSERT(::return_two() == "two") | ||
|
||
// static vars + chaining | ||
var/datum/test | ||
ASSERT(test::three::four.five::six == "three four five six") | ||
ASSERT(/datum::three::four.five::six == "three four five six") | ||
|
||
// reassigning global and static vars | ||
::one = "1" | ||
ASSERT(::one == "1") | ||
|
||
/datum::three::four::five::six = "3 4 5 6" | ||
ASSERT(test::three::four.five::six == "3 4 5 6") | ||
ASSERT(/datum::three::four.five::six == "3 4 5 6") | ||
|
||
// this does not compile in BYOND, that is just a bug | ||
test::three::four.five::six = "7 8 9 10" | ||
ASSERT(test::three::four.five::six == "7 8 9 10") | ||
ASSERT(/datum::three::four.five::six == "7 8 9 10") | ||
|
||
var/datum/three/threetest = new | ||
threetest.typetest() |
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,6 @@ | ||
/datum/proc/foo() | ||
set name = "abc" | ||
return | ||
|
||
/proc/RunTest() | ||
ASSERT((/datum/proc/foo::name) == "foo") |
9 changes: 9 additions & 0 deletions
9
Content.Tests/DMProject/Tests/Operators/scope_proc_pointless.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,9 @@ | ||
// COMPILE ERROR | ||
#pragma PointlessScopeOperator error | ||
|
||
/datum/proc/foo() | ||
set desc = "abc" | ||
return | ||
|
||
/proc/RunTest() | ||
var/desc = (/datum/proc/foo::desc) |
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,6 @@ | ||
// Just testing that this parses | ||
/proc/foo() as /list | ||
return list("a","b","c") | ||
|
||
/proc/RunTest() | ||
ASSERT(foo()[2] == "b") |
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,52 @@ | ||
/datum/foo | ||
var/best_map = "pl_upward" // mutated by RunTest(), should save | ||
var/worst_map = "pl_badwater" // same as, should not be saved | ||
var/null_me = "ok" // should save as null | ||
|
||
var/tmp/current_map = "yeah" // tmp, should not save | ||
var/const/default_cube = "delete it" // const, should not save | ||
|
||
New(args) | ||
proc_call_order_check += list("New") | ||
..() | ||
|
||
Read(savefile/F) | ||
proc_call_order_check += list("Read") | ||
..() | ||
|
||
Write(savefile/F) | ||
proc_call_order_check += list("Write") | ||
..() | ||
|
||
/var/static/proc_call_order_check = list() | ||
|
||
|
||
/proc/RunTest() | ||
var/savefile/S = new() | ||
|
||
var/datum/foo/F = new() | ||
F.best_map = "pl_pier" | ||
F.null_me = null | ||
|
||
S["mapdata"] << F | ||
|
||
// test the savefile's contents | ||
ASSERT(S["mapdata/.0/type"] == /datum/foo) | ||
ASSERT(S["mapdata/.0/best_map"] == "pl_pier") | ||
ASSERT(S["mapdata/.0/null_me"] == null) | ||
ASSERT(S["mapdata/.0/worst_map"] == null) | ||
ASSERT(S["mapdata/.0/current_map"] == null) | ||
ASSERT(S["mapdata/.0/default_cube"] == null) | ||
|
||
var/datum/foo/W | ||
S["mapdata"] >> W | ||
|
||
// load test | ||
ASSERT(istype(W)) | ||
ASSERT(W != F) //they are equivalent, but not the same datum | ||
ASSERT(W.best_map == "pl_pier") | ||
ASSERT(W.worst_map == "pl_badwater") | ||
ASSERT(W.null_me == null) | ||
|
||
ASSERT(proc_call_order_check ~= list("New","Write","New","Read")) | ||
|
Oops, something went wrong.