mirror of
https://github.com/Citadel-Station-13/Citadel-Station-13-RP.git
synced 2026-08-23 03:06:53 +01:00
- moves stuff to more sane places so modules folder isn't so messy - adds a world system that is the start of being able to data-define world locations and having the game act differently based on which location a map is in there's no ability to separate 'pre-load map' (and a way for persistence to inject this so we can have moving maps yet) but we can add it in later since things are decently abstracted.
24 lines
1.1 KiB
Plaintext
24 lines
1.1 KiB
Plaintext
/// Test to verify message mods are parsed correctly
|
|
/datum/unit_test/get_message_mods
|
|
var/mob/host_mob
|
|
|
|
/datum/unit_test/get_message_mods/Run()
|
|
host_mob = allocate(/mob/living/carbon/human)
|
|
|
|
test("Hello", "Hello", list())
|
|
test(";HELP", "HELP", list(MODE_HEADSET = TRUE))
|
|
test(";%Never gonna give you up", "Never gonna give you up", list(MODE_HEADSET = TRUE, MODE_SING = TRUE))
|
|
test(".s Gun plz", "Gun plz", list(RADIO_KEY = RADIO_KEY_SECURITY, RADIO_EXTENSION = RADIO_CHANNEL_SECURITY))
|
|
test("...What", "...What", list())
|
|
|
|
/datum/unit_test/get_message_mods/proc/test(message, expected_message, list/expected_mods)
|
|
var/list/mods = list()
|
|
TEST_ASSERT_EQUAL(host_mob.get_message_mods(message, mods), expected_message, "Chopped message was not what we expected. Message: [message]")
|
|
|
|
for (var/mod_key in mods)
|
|
TEST_ASSERT_EQUAL(mods[mod_key], expected_mods[mod_key], "The value for [mod_key] was not what we expected. Message: [message]")
|
|
expected_mods -= mod_key
|
|
|
|
if (expected_mods.len)
|
|
Fail("Some message mods were expected, but were not returned by get_message_mods: [json_encode(expected_mods)]. Message: [message]")
|