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.
10func Test_File_Size()
11  if !executable('cksum')
12      return
13  endif
14
15  new
16  set belloff=all fileformat=unix undolevels=-1
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 res = systemlist('cksum Xtest')[0]
24  let res = substitute(res, "\r", "", "")
25  call assert_equal('3678979763 14888896 Xtest', res)
26
27  enew!
28  call delete('Xtest')
29  set belloff& fileformat& undolevels&
30endfunc
31