polserver/testsuite/pol/scripts/include/testutil.inc
Kevin Eady d916f86408
Update container OnRemove, CanRemove program parameters (#647)
* Implementation
- Add `amount` to CanRemove script
- Add `split_from` to OnRemove script

* Tests

* Add docs and core-changes

* Fix tests... maybe?

* Restore testing for client events in container event tests
2024-05-16 22:49:51 +02:00

31 lines
658 B
C++

use uo;
const IGNORE_TEST:=255; // only valid for setup or programs
function ret_error(str)
return error{errortext:=str};
endfunction
function ret_error_not_equal( actual, expected, message )
if ( actual != expected )
return ret_error( $"{message}" );
endif
return 1;
endfunction
function createAccountWithChar(accname, psw)
var a:=FindAccount(accname);
if (!a)
a:=CreateAccount(accname,psw,1);
if (!a)
return ret_error("Failed to create account");
endif
a.addcharacter(0);
endif
var char:=a.getcharacter(1);
if (!char)
return ret_error("Could not find char at slot 1");
endif
return char;
endfunction