Mercurial > vim
comparison src/testdir/test_file_size.vim @ 11961:0240e7e3d736 v8.0.0861
patch 8.0.0861: still many old style tests
commit https://github.com/vim/vim/commit/4a137b45864310060410f34cb9c7d0f0231bb256
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Aug 4 22:37:11 2017 +0200
patch 8.0.0861: still many old style tests
Problem: Still many old style tests.
Solution: Convert several tests to new style. (Yegappan Lakshmanan)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 04 Aug 2017 22:45:04 +0200 |
parents | |
children | f1635be0e963 |
comparison
equal
deleted
inserted
replaced
11960:e9776f970210 | 11961:0240e7e3d736 |
---|---|
1 " Inserts 2 million lines with consecutive integers starting from 1 | |
2 " (essentially, the output of GNU's seq 1 2000000), writes them to Xtest | |
3 " and writes its cksum to test.out. | |
4 " | |
5 " We need 2 million lines to trigger a call to mf_hash_grow(). If it would mess | |
6 " up the lines the checksum would differ. | |
7 " | |
8 " cksum is part of POSIX and so should be available on most Unixes. | |
9 " If it isn't available then the test will be skipped. | |
10 func Test_File_Size() | |
11 if !executable('cksum') | |
12 return | |
13 endif | |
14 set belloff=all fileformat=unix undolevels=-1 | |
15 | |
16 new | |
17 for i in range(1, 2000000, 100) | |
18 call append(i, range(i, i + 99)) | |
19 endfor | |
20 | |
21 1delete | |
22 w! Xtest | |
23 let l = systemlist('cksum Xtest') | |
24 call assert_equal('3678979763 14888896 Xtest', l[0]) | |
25 | |
26 enew! | |
27 call delete('Xtest') | |
28 set belloff& fileformat& undolevels& | |
29 endfunc |