diff --git a/code/modules/unit_tests/_unit_tests.dm b/code/modules/unit_tests/_unit_tests.dm index c739d426c2..e758a43589 100644 --- a/code/modules/unit_tests/_unit_tests.dm +++ b/code/modules/unit_tests/_unit_tests.dm @@ -3,6 +3,7 @@ #ifdef UNIT_TESTS #include "anchored_mobs.dm" +#include "character_saving.dm" #include "component_tests.dm" #include "reagent_id_typos.dm" #include "reagent_recipe_collisions.dm" diff --git a/code/modules/unit_tests/character_saving.dm b/code/modules/unit_tests/character_saving.dm new file mode 100644 index 0000000000..6c83d4142a --- /dev/null +++ b/code/modules/unit_tests/character_saving.dm @@ -0,0 +1,14 @@ +/datum/unit_test/character_saving/Run() + try + var/datum/preferences/P = new + P.load_path("test") + P.features["flavor_text"] = "Foo" + P.features["ooc_notes"] = "Bar" + P.save_character() + P.load_character() + if(P.features["flavor_text"] != "Foo") + Fail("Flavor text is failing to save.") + if(P.features["ooc_notes"] != "Bar") + Fail("OOC text is failing to save.") + catch(var/exception/e) + Fail("Failed to save and load character due to exception [e.name]")