anchor.diff:      ?_assertEqual(ok, gen_tcp:close(Socket2)).
   
   publish_c2b_timeout_qos2(_) ->
  -    Connect = packet:gen_connect("pub-qos2-timeout-test", [{keepalive,60}]),
  -    Connack = packet:gen_connack(0),
  -    Publish = packet:gen_publish("pub/qos2/test", 2, <<"timeout-message">>, [{mid, 1926}]),
  +    Connect = packet:gen_connect("pub-qos2-timeout-test", [{keepalive, 60}]),
  +    Connack = packet:gen_connack(0),
  +    Publish = packet:gen_publish("pub/qos2/test", 2,
  +                                 <<"timeout-message">>, [{mid, 1926}]),
       Pubrec = packet:gen_pubrec(1926),
       Pubrel = packet:gen_pubrel(1926),
       Pubcomp = packet:gen_pubcomp(1926),
  
positive.code:     ok = packet:expect_packet(Socket, "suback", Suback),
      helper_pub_qos1("test-helper", 1, Publish),
      %% should have now received a publish command
      ok = packet:expect_packet(Socket, "publish", Publish), %% expect packet, but we don't ack
      %% send our outgoing message, when we disconnect the broker
      %% should get rid of it and ssume we're going to retry
      ok = gen_tcp:send(Socket, Publish2),
  
negative.code: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  subscribe_test_() ->
      [
       {"Publish QoS 1 Success",
        ?SETUP(fun publish_qos1/1)}
       , {"Publish QoS 2 Success",
          ?SETUP(fun publish_qos2/1)}
       , {"Publish B2C disconnect QoS 1 Success",
          ?SETUP(fun publish_b2c_disconnect_qos1/1)}
       , {"Publish B2C disconnect QoS 2 Success",
          ?SETUP(fun publish_b2c_disconnect_qos2/1)}
       , {"Publish B2C timeout QoS 1 Success",
          ?SETUP(fun publish_b2c_timeout_qos1/1)}
       , {"Publish B2C timeout QoS 2 Success",
          ?SETUP(fun publish_b2c_timeout_qos2/1)}
       , {"Publish C2B disconnect QoS 2 Success",
          ?SETUP(fun publish_c2b_disconnect_qos2/1)}
       , {"Publish C2B timeout QoS 2 Success",
          ?SETUP(fun publish_c2b_timeout_qos2/1)}
       , {"Pattern Matching PubSub Test",
          ?SETUP(fun pattern_matching/1)}
      ].
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  