diff --git a/soroban-hello-world/contracts/hello-world/src/test.rs b/soroban-hello-world/contracts/hello-world/src/test.rs new file mode 100644 index 00000000..af69a7ec --- /dev/null +++ b/soroban-hello-world/contracts/hello-world/src/test.rs @@ -0,0 +1,21 @@ +#![cfg(test)] + +use super::*; +use soroban_sdk::{vec, Env, String}; + +#[test] +fn test() { + let env = Env::default(); + let contract_id = env.register_contract(None, Contract); + let client = ContractClient::new(&env, &contract_id); + + let words = client.hello(&String::from_str(&env, "Dev")); + assert_eq!( + words, + vec![ + &env, + String::from_str(&env, "Hello"), + String::from_str(&env, "Dev"), + ] + ); +}