From 7b57ab1480951685fd34af2eba3a965745211706 Mon Sep 17 00:00:00 2001 From: Michael Ennen Date: Fri, 20 May 2016 23:32:01 -0700 Subject: [PATCH 1/2] vim-patch:7.4.1090 Problem: No tests for :hardcopy and related options. Solution: Add test_hardcopy. https://github.com/vim/vim/commit/b5690794cf081773628fa0f1f2b948fd129d5b39 --- src/nvim/testdir/Makefile | 1 + src/nvim/testdir/test_hardcopy.vim | 56 ++++++++++++++++++++++++++++++ src/nvim/version.c | 2 +- 3 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 src/nvim/testdir/test_hardcopy.vim diff --git a/src/nvim/testdir/Makefile b/src/nvim/testdir/Makefile index 90542a6a6c..936add4e90 100644 --- a/src/nvim/testdir/Makefile +++ b/src/nvim/testdir/Makefile @@ -39,6 +39,7 @@ SCRIPTS := \ # Keep test_alot*.res as the last one, sort the others. NEW_TESTS = \ test_cursor_func.res \ + test_hardcopy.res \ test_help_tagjump.res \ test_menu.res \ test_viml.res \ diff --git a/src/nvim/testdir/test_hardcopy.vim b/src/nvim/testdir/test_hardcopy.vim new file mode 100644 index 0000000000..ab51fc9065 --- /dev/null +++ b/src/nvim/testdir/test_hardcopy.vim @@ -0,0 +1,56 @@ +" Test :hardcopy + +func Test_printoptions_parsing() + " Only test that this doesn't throw an error. + set printoptions=left:5in,right:10pt,top:8mm,bottom:2pc + set printoptions=left:2in,top:30pt,right:16mm,bottom:3pc + set printoptions=header:3,syntax:y,number:7,wrap:n + set printoptions=duplex:short,collate:n,jobsplit:y,portrait:n + set printoptions=paper:10x14 + set printoptions=paper:A3 + set printoptions=paper:A4 + set printoptions=paper:A5 + set printoptions=paper:B4 + set printoptions=paper:B5 + set printoptions=paper:executive + set printoptions=paper:folio + set printoptions=paper:ledger + set printoptions=paper:legal + set printoptions=paper:letter + set printoptions=paper:quarto + set printoptions=paper:statement + set printoptions=paper:tabloid + set printoptions=formfeed:y + set printoptions= + set printoptions& +endfunc + +func Test_printmbfont_parsing() + " Only test that this doesn't throw an error. + set printmbfont=r:WadaMin-Regular,b:WadaMin-Bold,i:WadaMin-Italic,o:WadaMin-Bold-Italic,c:yes,a:no + set printmbfont= + set printmbfont& +endfunc + +func Test_printheader_parsing() + " Only test that this doesn't throw an error. + set printheader=%<%f\ %h%m%r%=%-14.(%l,%c%V%)\ %P + set printheader=%<%f%h%m%r%=%b\ 0x%B\ \ %l,%c%V\ %P + set printheader=%<%f%=\ [%1*%M%*%n%R%H]\ %-19(%3l,%02c%03V%)%O'%02b' + set printheader=...%r%{VarExists('b:gzflag','\ [GZ]')}%h... + set printheader= + set printheader& +endfunc + +" Test that :hardcopy produces a non-empty file. +" We don't check much of the contents. +func Test_with_syntax() + set printoptions=syntax:y + syn on + hardcopy > Xhardcopy + let lines = readfile('Xhardcopy') + call assert_true(len(lines) > 20) + call assert_true(lines[0] =~ 'PS-Adobe') + call delete('Xhardcopy') + set printoptions& +endfunc diff --git a/src/nvim/version.c b/src/nvim/version.c index fce2896ddf..dad128ae3c 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -594,7 +594,7 @@ static int included_patches[] = { 1093, 1092, 1091, - // 1090, + 1090, 1089, 1088, 1087, From 7db5ad4e4d4337e5ebbdf581a90af24126356ed2 Mon Sep 17 00:00:00 2001 From: Michael Ennen Date: Sat, 21 May 2016 00:00:38 -0700 Subject: [PATCH 2/2] vim-patch:7.4.1094 Problem: Test for :hardcopy fails on MS-Windows. Solution: Check for the +postscript feature. https://github.com/vim/vim/commit/ccb80989f2779c8441f7f15d160fb2141bd1676d --- src/nvim/testdir/test_hardcopy.vim | 114 +++++++++++++++-------------- src/nvim/version.c | 2 +- 2 files changed, 59 insertions(+), 57 deletions(-) diff --git a/src/nvim/testdir/test_hardcopy.vim b/src/nvim/testdir/test_hardcopy.vim index ab51fc9065..4629d17dd2 100644 --- a/src/nvim/testdir/test_hardcopy.vim +++ b/src/nvim/testdir/test_hardcopy.vim @@ -1,56 +1,58 @@ -" Test :hardcopy - -func Test_printoptions_parsing() - " Only test that this doesn't throw an error. - set printoptions=left:5in,right:10pt,top:8mm,bottom:2pc - set printoptions=left:2in,top:30pt,right:16mm,bottom:3pc - set printoptions=header:3,syntax:y,number:7,wrap:n - set printoptions=duplex:short,collate:n,jobsplit:y,portrait:n - set printoptions=paper:10x14 - set printoptions=paper:A3 - set printoptions=paper:A4 - set printoptions=paper:A5 - set printoptions=paper:B4 - set printoptions=paper:B5 - set printoptions=paper:executive - set printoptions=paper:folio - set printoptions=paper:ledger - set printoptions=paper:legal - set printoptions=paper:letter - set printoptions=paper:quarto - set printoptions=paper:statement - set printoptions=paper:tabloid - set printoptions=formfeed:y - set printoptions= - set printoptions& -endfunc - -func Test_printmbfont_parsing() - " Only test that this doesn't throw an error. - set printmbfont=r:WadaMin-Regular,b:WadaMin-Bold,i:WadaMin-Italic,o:WadaMin-Bold-Italic,c:yes,a:no - set printmbfont= - set printmbfont& -endfunc - -func Test_printheader_parsing() - " Only test that this doesn't throw an error. - set printheader=%<%f\ %h%m%r%=%-14.(%l,%c%V%)\ %P - set printheader=%<%f%h%m%r%=%b\ 0x%B\ \ %l,%c%V\ %P - set printheader=%<%f%=\ [%1*%M%*%n%R%H]\ %-19(%3l,%02c%03V%)%O'%02b' - set printheader=...%r%{VarExists('b:gzflag','\ [GZ]')}%h... - set printheader= - set printheader& -endfunc - -" Test that :hardcopy produces a non-empty file. -" We don't check much of the contents. -func Test_with_syntax() - set printoptions=syntax:y - syn on - hardcopy > Xhardcopy - let lines = readfile('Xhardcopy') - call assert_true(len(lines) > 20) - call assert_true(lines[0] =~ 'PS-Adobe') - call delete('Xhardcopy') - set printoptions& -endfunc +" Test :hardcopy + +func Test_printoptions_parsing() + " Only test that this doesn't throw an error. + set printoptions=left:5in,right:10pt,top:8mm,bottom:2pc + set printoptions=left:2in,top:30pt,right:16mm,bottom:3pc + set printoptions=header:3,syntax:y,number:7,wrap:n + set printoptions=duplex:short,collate:n,jobsplit:y,portrait:n + set printoptions=paper:10x14 + set printoptions=paper:A3 + set printoptions=paper:A4 + set printoptions=paper:A5 + set printoptions=paper:B4 + set printoptions=paper:B5 + set printoptions=paper:executive + set printoptions=paper:folio + set printoptions=paper:ledger + set printoptions=paper:legal + set printoptions=paper:letter + set printoptions=paper:quarto + set printoptions=paper:statement + set printoptions=paper:tabloid + set printoptions=formfeed:y + set printoptions= + set printoptions& +endfunc + +func Test_printmbfont_parsing() + " Only test that this doesn't throw an error. + set printmbfont=r:WadaMin-Regular,b:WadaMin-Bold,i:WadaMin-Italic,o:WadaMin-Bold-Italic,c:yes,a:no + set printmbfont= + set printmbfont& +endfunc + +func Test_printheader_parsing() + " Only test that this doesn't throw an error. + set printheader=%<%f\ %h%m%r%=%-14.(%l,%c%V%)\ %P + set printheader=%<%f%h%m%r%=%b\ 0x%B\ \ %l,%c%V\ %P + set printheader=%<%f%=\ [%1*%M%*%n%R%H]\ %-19(%3l,%02c%03V%)%O'%02b' + set printheader=...%r%{VarExists('b:gzflag','\ [GZ]')}%h... + set printheader= + set printheader& +endfunc + +" Test that :hardcopy produces a non-empty file. +" We don't check much of the contents. +func Test_with_syntax() + if has('postscript') + set printoptions=syntax:y + syn on + hardcopy > Xhardcopy + let lines = readfile('Xhardcopy') + call assert_true(len(lines) > 20) + call assert_true(lines[0] =~ 'PS-Adobe') + call delete('Xhardcopy') + set printoptions& + endif +endfunc diff --git a/src/nvim/version.c b/src/nvim/version.c index dad128ae3c..f582beef88 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -590,7 +590,7 @@ static int included_patches[] = { // 1097, // 1096, // 1095 NA - // 1094, + 1094, 1093, 1092, 1091,