diff --git a/erlang_js b/erlang_js index 5350ed2..2f2785f 160000 --- a/erlang_js +++ b/erlang_js @@ -1 +1 @@ -Subproject commit 5350ed21606606dbee5ecb07e974f2abb9106270 +Subproject commit 2f2785fafb0da6db75810eb6fa97d09c58257588 diff --git a/src/ggs_gamevm.erl b/src/ggs_gamevm.erl index 6493c9f..6dd19a7 100644 --- a/src/ggs_gamevm.erl +++ b/src/ggs_gamevm.erl @@ -119,4 +119,12 @@ user_command_test() -> define(GameVM, "var t = '';\nfunction userCommand(user, command, args) { t = user + command + args; }\n"), user_command(GameVM, "'jeena", "thecommand", "theargs'"), ?assertMatch(<<"'jeenathecommandtheargs'">>, gen_server:call(GameVM, {eval, "t;"})). - + +js_erlang_test() -> + GameVM = start_link(test_table), + define(GameVM, "var t = '';\nfunction userCommand(user, command, args) { t = callErlang('erlang time') + ''; }\n"), + user_command(GameVM, "", "", ""), + {A, B, C} = erlang:time(), + T = "{" ++ integer_to_list(A) ++ ", " ++ integer_to_list(B) ++ ", " ++ integer_to_list(C) ++ "}", + ?assertMatch(T, binary_to_list(gen_server:call(GameVM, {eval, "t;"}))). +