Skip to content

Commit cd58b0e

Browse files
committed
new test
1 parent 9c7bb81 commit cd58b0e

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

crates/byondapi-rs-test/dm_project/dm_project.dme

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,14 @@
153153
var/list/L = list("cat" = 0, "dog" = 1, "parrot" = 5)
154154
test_list_read(L)
155155

156+
/datum/testobject
157+
var/test_name = "dust"
158+
159+
/test/proc/test_byondapi_new()
160+
var/datum/testobject = test_new_obj()
161+
if(testobject.test_name != "dust")
162+
throw EXCEPTION("Did not create a new object!")
163+
156164
// BEGIN_INTERNALS
157165
// END_INTERNALS
158166
// BEGIN_FILE_DIR

crates/byondapi-rs-test/src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,3 +215,11 @@ fn test_list_read(list: ByondValue) {
215215

216216
Ok(Default::default())
217217
}
218+
219+
#[byondapi::bind]
220+
fn test_new_obj() {
221+
Ok(ByondValue::builtin_new(
222+
ByondValue::try_from("/datum/testobject")?,
223+
&[],
224+
)?)
225+
}

0 commit comments

Comments
 (0)