Skip to content

Commit

Permalink
new test
Browse files Browse the repository at this point in the history
  • Loading branch information
jupyterkat committed May 9, 2024
1 parent 9c7bb81 commit cd58b0e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions crates/byondapi-rs-test/dm_project/dm_project.dme
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,14 @@
var/list/L = list("cat" = 0, "dog" = 1, "parrot" = 5)
test_list_read(L)

/datum/testobject
var/test_name = "dust"

/test/proc/test_byondapi_new()
var/datum/testobject = test_new_obj()
if(testobject.test_name != "dust")
throw EXCEPTION("Did not create a new object!")

// BEGIN_INTERNALS
// END_INTERNALS
// BEGIN_FILE_DIR
Expand Down
8 changes: 8 additions & 0 deletions crates/byondapi-rs-test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,11 @@ fn test_list_read(list: ByondValue) {

Ok(Default::default())
}

#[byondapi::bind]
fn test_new_obj() {
Ok(ByondValue::builtin_new(
ByondValue::try_from("/datum/testobject")?,
&[],
)?)
}

0 comments on commit cd58b0e

Please sign in to comment.