anchor.diff:      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
  +    ok = packet:expect_packet(Socket, "publish", Publish),
  +    %% expect packet, but we don't ack
       %% The broker should repeat the PUBLISH with dup set
       ok = packet:expect_packet(Socket, "dup publish", PublishDup),
       ok = gen_tcp:send(Socket, Puback),
  
positive.code:     application:load(vmq_server),
      application:set_env(vmq_server, allow_anonymous, true),
      application:set_env(vmq_server, listeners,
                          {[?listener(1888)],[],[],[]}),
      application:set_env(vmq_server, retry_interval, 10),
      vmq_server:start_no_auth(),
      wait_til_ready().
  
negative.code:     ?_assertEqual(ok, gen_tcp:close(Socket)).
  
  publish_b2c_disconnect_qos1(_) ->
      Connect = packet:gen_connect("pub-qos1-disco-test",
                                   [{keepalive, 60}, {clean_session, false}]),
      Connack = packet:gen_connack(0),
      Subscribe = packet:gen_subscribe(3265, "qos1/disconnect/test", 1),
      Suback = packet:gen_suback(3265, 1),
      Publish = packet:gen_publish("qos1/disconnect/test", 1,
                                   <<"disconnect-message">>, [{mid, 1}]),
      PublishDup = packet:gen_publish("qos1/disconnect/test", 1,
                                      <<"disconnect-message">>,
                                      [{mid, 1}, {dup, true}]),
      Puback = packet:gen_puback(1),
      Publish2 = packet:gen_publish("qos1/outgoing", 1,
                                    <<"outgoing-message">>, [{mid, 3266}]),
      enable_on_publish(),
      enable_on_subscribe(),
      {ok, Socket} = packet:do_client_connect(Connect, Connack, []),
  