mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 13:10:02 +01:00
This commit is contained in:
@@ -46,6 +46,7 @@
|
||||
#include "achievements.dm"
|
||||
#include "anchored_mobs.dm"
|
||||
#include "anonymous_themes.dm"
|
||||
#include "autowiki.dm"
|
||||
#include "bespoke_id.dm"
|
||||
#include "binary_insert.dm"
|
||||
#include "bloody_footprints.dm"
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
/// Tests that all autowikis generate something without runtiming
|
||||
/datum/unit_test/autowiki
|
||||
|
||||
/datum/unit_test/autowiki/Run()
|
||||
TEST_ASSERT(istext(generate_autowiki_output()), "generate_autowiki_output() did not finish successfully!")
|
||||
|
||||
/// Test that `include_template` produces reasonable results
|
||||
/datum/unit_test/autowiki_include_template
|
||||
|
||||
/datum/unit_test/autowiki_include_template/Run()
|
||||
var/datum/autowiki/autowiki_api = new
|
||||
|
||||
TEST_ASSERT_EQUAL( \
|
||||
autowiki_api.include_template("Template"), \
|
||||
"{{Template}}", \
|
||||
"Basic template did not format correctly" \
|
||||
)
|
||||
|
||||
TEST_ASSERT_EQUAL( \
|
||||
autowiki_api.include_template("Template", list("name" = "Mothblocks")), \
|
||||
"{{Template|name=Mothblocks}}", \
|
||||
"Template with basic arguments did not format correctly" \
|
||||
)
|
||||
|
||||
TEST_ASSERT_EQUAL( \
|
||||
autowiki_api.include_template("Template", list("name" = autowiki_api.escape_value("P|peline"))), \
|
||||
"{{Template|name=P{{!}}peline}}", \
|
||||
"Template with escaped arguments did not format correctly" \
|
||||
)
|
||||
|
||||
TEST_ASSERT_EQUAL( \
|
||||
autowiki_api.include_template("Template", list("food" = list("fruit", "candy"))), \
|
||||
"{{Template|food1=fruit|food2=candy}}", \
|
||||
"Template with array arguments did not format correctly" \
|
||||
)
|
||||
Reference in New Issue
Block a user