mirror of
https://github.com/Citadel-Station-13/Citadel-Station-13-RP.git
synced 2026-08-17 12:56:49 +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.
27 lines
1.2 KiB
Plaintext
27 lines
1.2 KiB
Plaintext
/// A test to ensure the sanity of BINARY_INSERT
|
|
/datum/unit_test/binary_insert/Run()
|
|
var/list/datum/binary_insert_node/nodes = list()
|
|
|
|
var/datum/binary_insert_node/node_a = new /datum/binary_insert_node(10)
|
|
BINARY_INSERT(node_a, nodes, /datum/binary_insert_node, node_a, x, COMPARE_KEY)
|
|
TEST_ASSERT_EQUAL(nodes.len, 1, "List should have one node")
|
|
|
|
var/datum/binary_insert_node/node_b = new /datum/binary_insert_node(5)
|
|
BINARY_INSERT(node_b, nodes, /datum/binary_insert_node, node_b, x, COMPARE_KEY)
|
|
TEST_ASSERT_EQUAL(nodes.len, 2, "List should have two nodes")
|
|
TEST_ASSERT_EQUAL(nodes[1].x, 5, "The first node should be the one with 5")
|
|
TEST_ASSERT_EQUAL(nodes[2].x, 10, "The second node should be the one with 10")
|
|
|
|
var/datum/binary_insert_node/node_c = new /datum/binary_insert_node(15)
|
|
BINARY_INSERT(node_c, nodes, /datum/binary_insert_node, node_c, x, COMPARE_KEY)
|
|
TEST_ASSERT_EQUAL(nodes.len, 3, "List should have three nodes")
|
|
TEST_ASSERT_EQUAL(nodes[1].x, 5, "The first node should be the one with 5")
|
|
TEST_ASSERT_EQUAL(nodes[2].x, 10, "The second node should be the one with 10")
|
|
TEST_ASSERT_EQUAL(nodes[3].x, 15, "The third node should be the one with 15")
|
|
|
|
/datum/binary_insert_node
|
|
var/x
|
|
|
|
/datum/binary_insert_node/New(_x)
|
|
x = _x
|