mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-03-19 04:52:59 +01:00
erlang: added usage of cross-language test.
This commit is contained in:
parent
f5a7d444e2
commit
7d1e51437e
@ -1,7 +1,7 @@
|
|||||||
%%
|
%%
|
||||||
%% MessagePack for Erlang
|
%% MessagePack for Erlang
|
||||||
%%
|
%%
|
||||||
%% Copyright (C) 2009 UENISHI Kota
|
%% Copyright (C) 2009-2010 UENISHI Kota
|
||||||
%%
|
%%
|
||||||
%% Licensed under the Apache License, Version 2.0 (the "License");
|
%% Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
%% you may not use this file except in compliance with the License.
|
%% you may not use this file except in compliance with the License.
|
||||||
@ -332,16 +332,15 @@ test()->
|
|||||||
[0,42,"sum", [1,2]], [1,42, nil, [3]]
|
[0,42,"sum", [1,2]], [1,42, nil, [3]]
|
||||||
],
|
],
|
||||||
Passed = test_(Tests),
|
Passed = test_(Tests),
|
||||||
Passed = length(Tests).
|
Passed = length(Tests),
|
||||||
%% Port = open_port({spawn, "./a.out"}, [stream]),
|
{[Tests],<<>>} = msgpack:unpack(msgpack:pack([Tests])),
|
||||||
%% receive {Port, {data, Data}}->
|
Port = open_port({spawn, "ruby ../crosslang.rb"}, [binary]),
|
||||||
%% io:format("~p~n", [unpack_all( list_to_binary(Data) )])
|
true = port_command(Port, msgpack:pack(Tests) ),
|
||||||
%% after 1024-> timeout end,
|
%Port ! {self, {command, msgpack:pack(Tests)}}, ... not owner
|
||||||
%% Passed2 = test_(Tests, Port),
|
receive
|
||||||
%% Passed2 = length(Tests),
|
{Port, {data, Data}}-> {Tests, <<>>}=msgpack:unpack(Data)
|
||||||
%% Port ! {self(), close},
|
after 1024-> ?assert(false) end,
|
||||||
%% receive {Port, closed}-> ok
|
port_close(Port).
|
||||||
%% after 1024 -> timeout end.
|
|
||||||
|
|
||||||
test_([]) -> 0;
|
test_([]) -> 0;
|
||||||
test_([S|Rest])->
|
test_([S|Rest])->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user