summaryrefslogtreecommitdiff
path: root/src/testdir/test_file_size.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-09-28 21:52:17 +0200
committerBram Moolenaar <Bram@vim.org>2017-09-28 21:52:17 +0200
commitdb51007108a6ab0671e7f7b4844557cbe647185f (patch)
treeadd62305033a8f8aacc513705f5eb15d61ff3174 /src/testdir/test_file_size.vim
parent24a98a0eb77245adc50facad8b735b20bfd31a7e (diff)
downloadvim-git-db51007108a6ab0671e7f7b4844557cbe647185f.tar.gz
patch 8.0.1158: still old style testsv8.0.1158
Problem: Still old style tests. Solution: Convert serveral tests to new style. (Yegappan Lakshmanan)
Diffstat (limited to 'src/testdir/test_file_size.vim')
-rw-r--r--src/testdir/test_file_size.vim28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/testdir/test_file_size.vim b/src/testdir/test_file_size.vim
index 624d49359..8dac3b2ac 100644
--- a/src/testdir/test_file_size.vim
+++ b/src/testdir/test_file_size.vim
@@ -28,3 +28,31 @@ func Test_File_Size()
call delete('Xtest')
set belloff& fileformat& undolevels&
endfunc
+
+" Test for writing and reading a file of over 100 Kbyte
+func Test_File_Read_Write()
+ enew!
+
+ " Create a file with the following contents
+ " 1 line: "This is the start"
+ " 3001 lines: "This is the leader"
+ " 1 line: "This is the middle"
+ " 3001 lines: "This is the trailer"
+ " 1 line: "This is the end"
+ call append(0, "This is the start")
+ call append(1, repeat(["This is the leader"], 3001))
+ call append(3002, "This is the middle")
+ call append(3003, repeat(["This is the trailer"], 3001))
+ call append(6004, "This is the end")
+
+ write! Xtest
+ enew!
+ edit! Xtest
+
+ call assert_equal("This is the start", getline(1))
+ call assert_equal("This is the middle", getline(3003))
+ call assert_equal("This is the end", getline(6005))
+
+ enew!
+ call delete("Xtest")
+endfunc