added more test

This commit is contained in:
Jeena Paradies 2011-02-21 15:43:39 +01:00
parent 5bc862c6f9
commit b3d8c5ba99

View file

@ -120,3 +120,9 @@ user_command_test() ->
user_command(GameVM, "'jeena", "thecommand", "theargs'"),
?assertMatch(<<"'jeenathecommandtheargs'">>, gen_server:call(GameVM, {eval, "t;"})).
user_command2_test() ->
GameVM = start_link(test_table),
define(GameVM, "var t = '';\nfunction userCommand(user, command, args) { t = callErlang('erlang time') + ''; }\n"),
user_command(GameVM, "jeena", "test", ""),
io:format("test ~p~n", [binary_to_list(gen_server:call(GameVM, {eval, "t;"}))]),
?assertMatch(<<"rt">>, gen_server:call(GameVM, {eval, "t;"})).