-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix atom name/desc not copying on appearance set (#2145)
Co-authored-by: wixoaGit <[email protected]>
- Loading branch information
1 parent
d6d86da
commit b8e919d
Showing
24 changed files
with
216 additions
and
187 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
Content.IntegrationTests/DMProject/Tests/atom_appearance.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,10 @@ | ||
/obj/thingtocopy | ||
name = "hello" | ||
desc = "this is a thing" | ||
|
||
/proc/test_appearance() | ||
var/obj/thingtocopy/T = new() | ||
var/obj/otherthing = new() | ||
otherthing.appearance = T.appearance | ||
ASSERT(otherthing.name == T.name) | ||
ASSERT(otherthing.desc == T.desc) |
13 changes: 13 additions & 0 deletions
13
Content.IntegrationTests/DMProject/Tests/string_interpolation.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,13 @@ | ||
/obj/blombo | ||
name = "Blombo" | ||
gender = FEMALE | ||
|
||
/obj/blorpo | ||
name = "Blorpo" | ||
gender = MALE | ||
|
||
/proc/test_string_interpolation() | ||
var/obj/blombo/b = new | ||
var/obj/blorpo/b2 = new | ||
var/result_text = "[b]? Nobody likes \him. \He is awful! Unlike [b2]. \He is pretty cool!" | ||
ASSERT(result_text == "Blombo? Nobody likes her. She is awful! Unlike Blorpo. He is pretty cool!") |
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 |
---|---|---|
@@ -1,10 +1,12 @@ | ||
#include "code.dm" | ||
#include "Tests/atom_appearance.dm" | ||
#include "Tests/block.dm" | ||
#include "Tests/color_matrix.dm" | ||
#include "Tests/range.dm" | ||
#include "Tests/verb_duplicate.dm" | ||
#include "Tests/nonlocal_var.dm" | ||
#include "Tests/image.dm" | ||
#include "Tests/filter_initial.dm" | ||
#include "Tests/string_interpolation.dm" | ||
#include "map.dmm" | ||
#include "interface.dmf" |
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
12 changes: 7 additions & 5 deletions
12
Content.Tests/DMProject/Tests/Preprocessor/macro_numeric_path.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,15 +1,17 @@ | ||
/obj/thing_1/dodaa | ||
/datum/var/name | ||
|
||
/datum/thing_1/dodaa | ||
name = "underscore 1 test" | ||
|
||
#define NUMPATH_OBJDEF(num) /obj/thing_##num/name = #num | ||
#define NUMPATH_OBJDEF(num) /datum/thing_##num/name = #num | ||
|
||
NUMPATH_OBJDEF(4) | ||
NUMPATH_OBJDEF(stuff) | ||
|
||
/proc/RunTest() | ||
var/obj/thing_1/dodaa/D = new | ||
var/datum/thing_1/dodaa/D = new | ||
ASSERT(D.name == "underscore 1 test") | ||
var/obj/thing_4/T = new | ||
var/datum/thing_4/T = new | ||
ASSERT(T.name == "4") | ||
var/obj/thing_stuff/Y = new | ||
var/datum/thing_stuff/Y = new | ||
ASSERT(Y.name == "stuff") |
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,8 +1,8 @@ | ||
|
||
/obj/blombo | ||
name = "Blombo" | ||
/datum/blombo | ||
var/name = "Blombo" | ||
|
||
/proc/RunTest() | ||
var/obj/blombo/b = new | ||
var/datum/blombo/b = new | ||
var/result_text = "Nobody likes [b]!" | ||
ASSERT(result_text == "Nobody likes Blombo!") |
31 changes: 20 additions & 11 deletions
31
Content.Tests/DMProject/Tests/Text/StringInterpolation3.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,14 +1,23 @@ | ||
/datum/test/var/name | ||
|
||
/obj/blombo | ||
name = "Blombo" | ||
gender = FEMALE | ||
|
||
/obj/blorpo | ||
name = "Blorpo" | ||
gender = MALE | ||
/datum/test/test1 | ||
name = "" | ||
/datum/test/test2 | ||
name = " " // 3 spaces | ||
/datum/test/test3 | ||
name = "\t" | ||
|
||
/proc/RunTest() | ||
var/obj/blombo/b = new | ||
var/obj/blorpo/b2 = new | ||
var/result_text = "[b]? Nobody likes \him. \He is awful! Unlike [b2]. \He is pretty cool!" | ||
ASSERT(result_text == "Blombo? Nobody likes her. She is awful! Unlike Blorpo. He is pretty cool!") | ||
var/list/correct = list( | ||
"/datum/test/test1: ", | ||
"/datum/test/test2: ", | ||
"/datum/test/test3: \t" | ||
) | ||
var/i = 1 | ||
for (var/T in typesof(/datum/test)) | ||
if(T == /datum/test) | ||
continue | ||
var/datum/test/D = new T() | ||
var/true_text = correct[i] | ||
ASSERT(true_text == "[T]: \the [D]") | ||
++i |
32 changes: 13 additions & 19 deletions
32
Content.Tests/DMProject/Tests/Text/StringInterpolation4.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,21 +1,15 @@ | ||
/obj/test1 | ||
name = "" | ||
/obj/test2 | ||
name = " " // 3 spaces | ||
/obj/test3 | ||
name = "\t" | ||
|
||
|
||
/proc/RunTest() | ||
var/list/correct = list( | ||
"/obj/test1: ", | ||
"/obj/test2: ", | ||
"/obj/test3: \t" | ||
) | ||
var/i = 1 | ||
for (var/T in typesof(/obj)) | ||
if(T == /obj) | ||
continue | ||
var/obj/O = new T() | ||
var/true_text = correct[i] | ||
ASSERT(true_text == "[T]: \the [O]") | ||
++i | ||
var/text = "["1"]\s" | ||
ASSERT(text == "1s") | ||
text = "[0]\s" | ||
ASSERT(text == "0s") | ||
text = "[null]\s" | ||
ASSERT(text == "s") | ||
text = "[1]\s" | ||
ASSERT(text == "1") | ||
text = "[1.00000001]\s" | ||
ASSERT(text == "1") | ||
text = "[1.0001]\s" | ||
ASSERT(text == "1.0001s") |
35 changes: 27 additions & 8 deletions
35
Content.Tests/DMProject/Tests/Text/StringInterpolation5.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,11 +1,30 @@ | ||
|
||
|
||
/proc/RunTest() | ||
var/atom/O = new() | ||
O.name = "foo" | ||
O.gender = FEMALE | ||
var/atom/O2 = new | ||
O2.name = "foob" | ||
O2.gender = MALE | ||
var/text = "[O2], \ref[O], \his" | ||
ASSERT(findtextEx(text,", his") != 0) | ||
var/text = "[0]\th" | ||
ASSERT(text == "0th") | ||
text = "[1]\th" | ||
ASSERT(text == "1st") | ||
text = "[2]\th" | ||
ASSERT(text == "2nd") | ||
text = "[3]\th" | ||
ASSERT(text == "3rd") | ||
text = "[4]\th" | ||
ASSERT(text == "4th") | ||
text = "[-1]\th" | ||
ASSERT(text == "-1th") | ||
text = "[4.52]\th" | ||
ASSERT(text == "4th") | ||
text = "the fitness [1.7]\th is a" | ||
ASSERT(text == "the fitness 1st is a") | ||
text = "the fitness [99999999]\th is a" | ||
ASSERT(text == "the fitness 100000000th is a") | ||
text = "[null]\th" | ||
ASSERT(text == "0th") | ||
var/datum/D = new | ||
text = "[D]\th" | ||
ASSERT(text == "0th") | ||
var/foo = "bar" | ||
text = "[foo]\th" | ||
ASSERT(text == "0th") | ||
|
26 changes: 11 additions & 15 deletions
26
Content.Tests/DMProject/Tests/Text/StringInterpolation6.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,15 +1,11 @@ | ||
|
||
|
||
/proc/RunTest() | ||
var/text = "["1"]\s" | ||
ASSERT(text == "1s") | ||
text = "[0]\s" | ||
ASSERT(text == "0s") | ||
text = "[null]\s" | ||
ASSERT(text == "s") | ||
text = "[1]\s" | ||
ASSERT(text == "1") | ||
text = "[1.00000001]\s" | ||
ASSERT(text == "1") | ||
text = "[1.0001]\s" | ||
ASSERT(text == "1.0001s") | ||
/proc/RunTest() | ||
ASSERT("\roman[1.5]" == "i") | ||
ASSERT("\roman [1.5]" == " i") | ||
ASSERT("\Roman[1.5]" == "I") | ||
ASSERT("\Roman [1.5]" == " I") | ||
ASSERT("\roman shitposts [1]" == " shitposts i") | ||
ASSERT("\roman shitposts [1] \the [2] [3]\s" == " shitposts i 3s") | ||
ASSERT("\roman[1.#INF]" == "∞") | ||
ASSERT("\roman[-1.#INF]" == "-∞") | ||
ASSERT("\roman [-1.#INF]" == " -∞") | ||
ASSERT("\roman[1.#IND]" == "�") |
61 changes: 35 additions & 26 deletions
61
Content.Tests/DMProject/Tests/Text/StringInterpolation7.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,30 +1,39 @@ | ||
/datum/thing | ||
var/name = "thing" | ||
|
||
/datum/Thing | ||
var/name = "Thing" | ||
|
||
/datum/proper_thing | ||
var/name = "\proper thing" | ||
|
||
/datum/plural_things | ||
var/name = "things" | ||
var/gender = PLURAL | ||
|
||
/proc/RunTest() | ||
var/text = "[0]\th" | ||
ASSERT(text == "0th") | ||
text = "[1]\th" | ||
ASSERT(text == "1st") | ||
text = "[2]\th" | ||
ASSERT(text == "2nd") | ||
text = "[3]\th" | ||
ASSERT(text == "3rd") | ||
text = "[4]\th" | ||
ASSERT(text == "4th") | ||
text = "[-1]\th" | ||
ASSERT(text == "-1th") | ||
text = "[4.52]\th" | ||
ASSERT(text == "4th") | ||
text = "the fitness [1.7]\th is a" | ||
ASSERT(text == "the fitness 1st is a") | ||
text = "the fitness [99999999]\th is a" | ||
ASSERT(text == "the fitness 100000000th is a") | ||
text = "[null]\th" | ||
ASSERT(text == "0th") | ||
var/datum/D = new | ||
text = "[D]\th" | ||
ASSERT(text == "0th") | ||
var/foo = "bar" | ||
text = "[foo]\th" | ||
ASSERT(text == "0th") | ||
// Lowercase \a on datums | ||
ASSERT("\a [new /datum/thing]" == "a thing") | ||
ASSERT("\a [new /datum/Thing]" == "Thing") | ||
ASSERT("\a [new /datum/proper_thing]" == "thing") | ||
ASSERT("\a [new /datum/plural_things]" == "some things") | ||
|
||
// Uppercase \A on datums | ||
ASSERT("\A [new /datum/thing]" == "A thing") | ||
ASSERT("\A [new /datum/Thing]" == "Thing") | ||
ASSERT("\A [new /datum/proper_thing]" == "thing") | ||
ASSERT("\A [new /datum/plural_things]" == "Some things") | ||
|
||
// Lowercase \a on strings | ||
ASSERT("\a ["thing"]" == "a thing") | ||
ASSERT("\a ["Thing"]" == "Thing") | ||
ASSERT("\a ["\proper thing"]" == "thing") | ||
|
||
// Uppercase \A on strings | ||
ASSERT("\A ["thing"]" == "A thing") | ||
ASSERT("\A ["Thing"]" == "Thing") | ||
ASSERT("\A ["\proper thing"]" == "thing") | ||
|
||
// Invalid \a | ||
ASSERT("\a [123]" == "") | ||
ASSERT("\A [123]" == "") |
11 changes: 0 additions & 11 deletions
11
Content.Tests/DMProject/Tests/Text/StringInterpolation8.dm
This file was deleted.
Oops, something went wrong.
39 changes: 0 additions & 39 deletions
39
Content.Tests/DMProject/Tests/Text/StringInterpolation9.dm
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
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
Oops, something went wrong.