#pragma save_types, rtt_checks
#include "/inc/base.inc"
#include "/inc/client.inc"

void receive_nl()
{
    // Just to make sure.
    call_out(#'shutdown, __HEART_BEAT_INTERVAL__, 1);
    
	input_to(#'receive_cmd);
}

void receive_cmd(string str)
{
	input_to(#'receive_cmd);

    if(sizeof(str))
    {
        remove_call_out(#'shutdown);
        shutdown(0);
    }
}

void send_no_nl()
{
    write("This will not be received");
    remove_interactive(this_object());
}

void run_test()
{
    msg("\nRunning test for #0000738:\n"
          "--------------------------\n");

    /* We'll send text and *no* new line and close the connection.
     * This test succeeds if the input_to on the other
     * end receives any text
     */
    connect_self("receive_nl", "send_no_nl");
}

string *epilog(int eflag)
{
    run_test();
    return 0;
}
