comparison src/testdir/test_hardcopy.vim @ 23452:8fa9d31cd248 v8.2.2269

patch 8.2.2269: not all :hardcopy code covered by tests Commit: https://github.com/vim/vim/commit/edc10b541b468f5f5aa2e2d5ef58a3e17e043bff Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jan 1 21:34:37 2021 +0100 patch 8.2.2269: not all :hardcopy code covered by tests Problem: Not all :hardcopy code covered by tests. Solution: Test more combinations. (Dominique Pell?, closes https://github.com/vim/vim/issues/7595)
author Bram Moolenaar <Bram@vim.org>
date Fri, 01 Jan 2021 21:45:04 +0100
parents f43c0e669bd6
children c2c40cefc17b
comparison
equal deleted inserted replaced
23451:f859dff5b9f8 23452:8fa9d31cd248
8 8
9 for opt in ['left:5in,right:10pt,top:8mm,bottom:2pc', 9 for opt in ['left:5in,right:10pt,top:8mm,bottom:2pc',
10 \ 'left:2in,top:30pt,right:16mm,bottom:3pc', 10 \ 'left:2in,top:30pt,right:16mm,bottom:3pc',
11 \ 'header:3,syntax:y,number:y,wrap:n', 11 \ 'header:3,syntax:y,number:y,wrap:n',
12 \ 'header:3,syntax:n,number:y,wrap:y', 12 \ 'header:3,syntax:n,number:y,wrap:y',
13 \ 'header:0,syntax:a,number:y,wrap:y',
13 \ 'duplex:short,collate:n,jobsplit:y,portrait:n', 14 \ 'duplex:short,collate:n,jobsplit:y,portrait:n',
14 \ 'duplex:long,collate:y,jobsplit:n,portrait:y', 15 \ 'duplex:long,collate:y,jobsplit:n,portrait:y',
16 \ 'duplex:off,collate:y,jobsplit:y,portrait:y',
15 \ 'paper:10x14', 17 \ 'paper:10x14',
16 \ 'paper:A3', 18 \ 'paper:A3',
17 \ 'paper:A4', 19 \ 'paper:A4',
18 \ 'paper:A5', 20 \ 'paper:A5',
19 \ 'paper:B4', 21 \ 'paper:B4',
44 set printoptions& 46 set printoptions&
45 bwipe 47 bwipe
46 endfunc 48 endfunc
47 49
48 func Test_printmbfont() 50 func Test_printmbfont()
49 " Print a small help page which contains tabs to cover code that expands tabs to spaces. 51 " Print a help page which contains tabs, underlines (etc) to recover more code.
50 help help 52 help syntax.txt
51 syn on 53 syn on
52 54
53 for opt in [':WadaMin-Regular,b:WadaMin-Bold,i:WadaMin-Italic,o:WadaMin-Bold-Italic,c:yes,a:no', 55 for opt in [':WadaMin-Regular,b:WadaMin-Bold,i:WadaMin-Italic,o:WadaMin-Bold-Italic,c:yes,a:no',
54 \ ''] 56 \ '']
55 exe 'set printmbfont=' .. opt 57 exe 'set printmbfont=' .. opt
68 func Test_printmbcharset() 70 func Test_printmbcharset()
69 CheckFeature postscript 71 CheckFeature postscript
70 72
71 " digraph.txt has plenty of non-latin1 characters. 73 " digraph.txt has plenty of non-latin1 characters.
72 help digraph.txt 74 help digraph.txt
73 set printmbcharset=ISO10646 printencoding=utf-8 printmbfont=r:WadaMin-Regular 75 set printmbcharset=ISO10646 printencoding=utf-8
74 76 for courier in ['yes', 'no']
75 hardcopy > Xhardcopy_printmbcharset 77 for ascii in ['yes', 'no']
76 let lines = readfile('Xhardcopy_printmbcharset') 78 exe 'set printmbfont=r:WadaMin-Regular,b:WadaMin-Bold,i:WadaMin-Italic,o:WadaMin-BoldItalic'
77 call assert_true(len(lines) > 20) 79 \ .. ',c:' .. courier .. ',a:' .. ascii
78 call assert_true(lines[0] =~ 'PS-Adobe') 80 hardcopy > Xhardcopy_printmbcharset
81 let lines = readfile('Xhardcopy_printmbcharset')
82 call assert_true(len(lines) > 20)
83 call assert_true(lines[0] =~ 'PS-Adobe')
84 endfor
85 endfor
79 86
80 set printmbcharset=does-not-exist printencoding=utf-8 printmbfont=r:WadaMin-Regular 87 set printmbcharset=does-not-exist printencoding=utf-8 printmbfont=r:WadaMin-Regular
81 call assert_fails('hardcopy > Xhardcopy_printmbcharset', 'E456:') 88 call assert_fails('hardcopy > Xhardcopy_printmbcharset', 'E456:')
82 89
83 set printmbcharset=GB_2312-80 printencoding=utf-8 printmbfont=r:WadaMin-Regular 90 set printmbcharset=GB_2312-80 printencoding=utf-8 printmbfont=r:WadaMin-Regular