#include <gtk/gtk.h>

int
main (int argc, char** argv)
{
  GtkTextBuffer *buffer;
  GtkTextIter iter;
  gint l;

  gtk_init (&argc, &argv);

  buffer = gtk_text_buffer_new (NULL);

  gtk_text_buffer_set_text (buffer, "foo\ra\nbar\n", -1);

  /* delete 'a' so that we have

     1 foo\r
     2 \n
     3 bar\n

   * note that both \r and \n are line separators, so they
   * should not be treated as one \r\n separator.
   */

  gtk_text_buffer_get_iter_at_offset (buffer, &iter, 5);
  gtk_text_buffer_backspace (buffer, &iter, TRUE, TRUE);

  g_assert (gtk_text_iter_ends_line (&iter));
}
