better js_erlang_test
This commit is contained in:
parent
08e0be70e2
commit
e03f3cf69d
1 changed files with 4 additions and 7 deletions
|
@ -120,14 +120,11 @@ user_command_test() ->
|
||||||
user_command(GameVM, "'jeena", "thecommand", "theargs'"),
|
user_command(GameVM, "'jeena", "thecommand", "theargs'"),
|
||||||
?assertMatch(<<"'jeenathecommandtheargs'">>, gen_server:call(GameVM, {eval, "t;"})).
|
?assertMatch(<<"'jeenathecommandtheargs'">>, gen_server:call(GameVM, {eval, "t;"})).
|
||||||
|
|
||||||
to_string({A, B, C}) ->
|
js_erlang_test() ->
|
||||||
"{" ++ integer_to_list(A) ++ ", " ++ integer_to_list(B) ++ ", " ++ integer_to_list(C) ++ "}".
|
|
||||||
|
|
||||||
user_command2_test() ->
|
|
||||||
GameVM = start_link(test_table),
|
GameVM = start_link(test_table),
|
||||||
define(GameVM, "var t = '';\nfunction userCommand(user, command, args) { t = callErlang('erlang time') + ''; }\n"),
|
define(GameVM, "var t = '';\nfunction userCommand(user, command, args) { t = callErlang('erlang time') + ''; }\n"),
|
||||||
user_command(GameVM, "", "", ""),
|
user_command(GameVM, "", "", ""),
|
||||||
T = to_string(erlang:time()),
|
{A, B, C} = erlang:time(),
|
||||||
io:format("test ~p~n", [T]),
|
T = "{" ++ integer_to_list(A) ++ ", " ++ integer_to_list(B) ++ ", " ++ integer_to_list(C) ++ "}",
|
||||||
?assertMatch(T, binary_to_list(gen_server:call(GameVM, {eval, "t;"}))).
|
?assertMatch(T, binary_to_list(gen_server:call(GameVM, {eval, "t;"}))).
|
||||||
|
|
||||||
|
|
Reference in a new issue