Mercurial > vim
annotate src/testdir/test_file_size.vim @ 12291:c3548d947646 v8.0.1025
patch 8.0.1025: stray copy command in test
commit https://github.com/vim/vim/commit/4e83961985abb78757b135f29ac4ffde675247af
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Aug 30 21:58:03 2017 +0200
patch 8.0.1025: stray copy command in test
Problem: Stray copy command in test.
Solution: Remove the copy command.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 30 Aug 2017 22:00:05 +0200 |
parents | f1635be0e963 |
children | 44aa2997239d |
rev | line source |
---|---|
11961
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Inserts 2 million lines with consecutive integers starting from 1 |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 " (essentially, the output of GNU's seq 1 2000000), writes them to Xtest |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 " and writes its cksum to test.out. |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 " |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 " We need 2 million lines to trigger a call to mf_hash_grow(). If it would mess |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 " up the lines the checksum would differ. |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 " |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 " cksum is part of POSIX and so should be available on most Unixes. |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 " If it isn't available then the test will be skipped. |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 func Test_File_Size() |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 if !executable('cksum') |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 return |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 endif |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 new |
11963
f1635be0e963
patch 8.0.0862: file size test fails on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
11961
diff
changeset
|
16 set belloff=all fileformat=unix undolevels=-1 |
11961
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 for i in range(1, 2000000, 100) |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 call append(i, range(i, i + 99)) |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 endfor |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 1delete |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 w! Xtest |
11963
f1635be0e963
patch 8.0.0862: file size test fails on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
11961
diff
changeset
|
23 let res = systemlist('cksum Xtest')[0] |
f1635be0e963
patch 8.0.0862: file size test fails on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
11961
diff
changeset
|
24 let res = substitute(res, "\r", "", "") |
f1635be0e963
patch 8.0.0862: file size test fails on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
11961
diff
changeset
|
25 call assert_equal('3678979763 14888896 Xtest', res) |
11961
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 enew! |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 call delete('Xtest') |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
29 set belloff& fileformat& undolevels& |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 endfunc |