Github user djnym commented on a diff in the pull request:

    https://github.com/apache/thrift/pull/1316#discussion_r129973689
  
    --- Diff: lib/erl/test/test_omit.erl ---
    @@ -0,0 +1,82 @@
    +-module(test_omit).
    +
    +-include("gen-erl/thrift_omit_with_types.hrl").
    +
    +-ifdef(TEST).
    +-include_lib("eunit/include/eunit.hrl").
    +
    +omit_struct1_test() ->
    +  %% In this test, the field that is deleted is a basic type (an i32).
    +  A = #test1{one = 1, three = 3},
    +  B = #test1{one = 1, two = 2, three = 3},
    +  {ok, Transport} = thrift_membuffer_transport:new(),
    +  {ok, P0} = thrift_binary_protocol:new(Transport),
    +
    +  {P1, ok} = thrift_protocol:write(P0, {{struct, {thrift_omit_with_types, 
element(1, A)}}, A}),
    +  {P2, {ok, O0}} = thrift_protocol:read(P1, {struct, 
{thrift_omit_without_types, element(1, A)}}),
    +  ?assertEqual(element(1, A), element(1, O0)),
    +  ?assertEqual(element(2, A), element(2, O0)),
    +  ?assertEqual(element(4, A), element(3, O0)),
    +
    +  {P3, ok} = thrift_protocol:write(P2, {{struct, {thrift_omit_with_types, 
element(1, B)}}, B}),
    +  {_P4, {ok, O1}} = thrift_protocol:read(P3, {struct, 
{thrift_omit_without_types, element(1, A)}}),
    +  %% io:format(user, "~p ~p\n", [ A, O1 ]),
    --- End diff --
    
    Probably don't need this commented out line.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to