[gedit/docstream2: 10/16] Added tests for input text without trailing newlines
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gedit/docstream2: 10/16] Added tests for input text without trailing newlines
- Date: Sat, 23 Jan 2010 13:31:00 +0000 (UTC)
commit 141b70613e0779920f1f2c4ff1836689edc32f7d
Author: Jesse van den Kieboom <jesse icecrew nl>
Date: Sat Jan 23 12:36:24 2010 +0100
Added tests for input text without trailing newlines
tests/document-input-stream.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/tests/document-input-stream.c b/tests/document-input-stream.c
index edcad1d..8f6bfbe 100644
--- a/tests/document-input-stream.c
+++ b/tests/document-input-stream.c
@@ -67,24 +67,39 @@ test_consecutive_cut_char ()
{
/* first \n is read then fo and then is added \r but not \n */
test_consecutive_read ("\nfo\nbar\n\nblah\n", "\r\nfo\r\nbar\r\n\r\nblah\r\n\r\n", GEDIT_DOCUMENT_NEWLINE_TYPE_CR_LF, 8);
+ test_consecutive_read ("\nfo\nbar\n\nblah", "\r\nfo\r\nbar\r\n\r\nblah\r\n", GEDIT_DOCUMENT_NEWLINE_TYPE_CR_LF, 8);
}
static void
test_consecutive_big_read ()
{
test_consecutive_read ("\nfo\nbar\n\nblah\n", "\rfo\rbar\r\rblah\r\r", GEDIT_DOCUMENT_NEWLINE_TYPE_CR, 200);
+ test_consecutive_read ("\nfo\nbar\n\nblah", "\rfo\rbar\r\rblah\r", GEDIT_DOCUMENT_NEWLINE_TYPE_CR, 200);
+
test_consecutive_read ("\rfo\rbar\r\rblah\r", "\nfo\nbar\n\nblah\n\n", GEDIT_DOCUMENT_NEWLINE_TYPE_LF, 200);
+ test_consecutive_read ("\rfo\rbar\r\rblah", "\nfo\nbar\n\nblah\n", GEDIT_DOCUMENT_NEWLINE_TYPE_LF, 200);
+
test_consecutive_read ("\r\nfo\r\nbar\r\n\r\nblah\r\n", "\nfo\nbar\n\nblah\n\n", GEDIT_DOCUMENT_NEWLINE_TYPE_LF, 200);
+ test_consecutive_read ("\r\nfo\r\nbar\r\n\r\nblah", "\nfo\nbar\n\nblah\n", GEDIT_DOCUMENT_NEWLINE_TYPE_LF, 200);
+
test_consecutive_read ("\nfo\nbar\n\nblah\n", "\r\nfo\r\nbar\r\n\r\nblah\r\n\r\n", GEDIT_DOCUMENT_NEWLINE_TYPE_CR_LF, 200);
+ test_consecutive_read ("\nfo\nbar\n\nblah", "\r\nfo\r\nbar\r\n\r\nblah\r\n", GEDIT_DOCUMENT_NEWLINE_TYPE_CR_LF, 200);
}
static void
test_consecutive_middle_read ()
{
test_consecutive_read ("\nfo\nbar\n\nblah\n", "\rfo\rbar\r\rblah\r\r", GEDIT_DOCUMENT_NEWLINE_TYPE_CR, 6);
+ test_consecutive_read ("\nfo\nbar\n\nblah", "\rfo\rbar\r\rblah\r", GEDIT_DOCUMENT_NEWLINE_TYPE_CR, 6);
+
test_consecutive_read ("\rfo\rbar\r\rblah\r", "\nfo\nbar\n\nblah\n\n", GEDIT_DOCUMENT_NEWLINE_TYPE_LF, 6);
+ test_consecutive_read ("\rfo\rbar\r\rblah", "\nfo\nbar\n\nblah\n", GEDIT_DOCUMENT_NEWLINE_TYPE_LF, 6);
+
test_consecutive_read ("\r\nfo\r\nbar\r\n\r\nblah\r\n", "\nfo\nbar\n\nblah\n\n", GEDIT_DOCUMENT_NEWLINE_TYPE_LF, 6);
+ test_consecutive_read ("\r\nfo\r\nbar\r\n\r\nblah", "\nfo\nbar\n\nblah\n", GEDIT_DOCUMENT_NEWLINE_TYPE_LF, 6);
+
test_consecutive_read ("\nfo\nbar\n\nblah\n", "\r\nfo\r\nbar\r\n\r\nblah\r\n\r\n", GEDIT_DOCUMENT_NEWLINE_TYPE_CR_LF, 6);
+ test_consecutive_read ("\nfo\nbar\n\nblah", "\r\nfo\r\nbar\r\n\r\nblah\r\n", GEDIT_DOCUMENT_NEWLINE_TYPE_CR_LF, 6);
}
int main (int argc,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]