summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-01-14 22:10:41 +0100
committerBram Moolenaar <Bram@vim.org>2016-01-14 22:10:41 +0100
commitb5690794cf081773628fa0f1f2b948fd129d5b39 (patch)
treed097d84cc0b110780a0ef2ff6986a6682709f495
parentef2b5036b3005f1ce15d146dce72379a9834c56d (diff)
downloadvim-git-b5690794cf081773628fa0f1f2b948fd129d5b39.tar.gz
patch 7.4.1090v7.4.1090
Problem: No tests for :hardcopy and related options. Solution: Add test_hardcopy.
-rw-r--r--src/Makefile1
-rw-r--r--src/testdir/Make_all.mak1
-rw-r--r--src/testdir/test_hardcopy.vim56
-rw-r--r--src/version.c2
4 files changed, 60 insertions, 0 deletions
diff --git a/src/Makefile b/src/Makefile
index 73f8554ea..42c86f30b 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1981,6 +1981,7 @@ test1 \
test_assert \
test_backspace_opt \
test_cdo \
+ test_hardcopy \
test_increment \
test_lispwords \
test_menu \
diff --git a/src/testdir/Make_all.mak b/src/testdir/Make_all.mak
index f39245190..6af9b84b0 100644
--- a/src/testdir/Make_all.mak
+++ b/src/testdir/Make_all.mak
@@ -173,6 +173,7 @@ SCRIPTS_GUI = test16.out
# Keep test_alot.res as the last one, sort the others.
NEW_TESTS = test_assert.res \
test_cdo.res \
+ test_hardcopy.res \
test_increment.res \
test_quickfix.res \
test_viml.res \
diff --git a/src/testdir/test_hardcopy.vim b/src/testdir/test_hardcopy.vim
new file mode 100644
index 000000000..c2145c13f
--- /dev/null
+++ b/src/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/version.c b/src/version.c
index db29e36b5..80a0693b2 100644
--- a/src/version.c
+++ b/src/version.c
@@ -742,6 +742,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1090,
+/**/
1089,
/**/
1088,