From: Alexandre Constantino Date: Thu, 14 Jan 2016 21:11:07 +0000 (+0000) Subject: Fix toc-autofit test and travis build config X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/d346b2cf5a80a3757a01a683a047a68dd3d2c276?ds=sidebyside Fix toc-autofit test and travis build config Because the toc-autofit test needs a reasonable terminal width (in our case 80 will suffice) it sets the travis environment to use 80 columns, as mentioned in https://github.com/travis-ci/travis-ci/issues/5407 --- diff --git a/.travis.yml b/.travis.yml index a2bf915..fde0658 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,5 +20,7 @@ before_script: | sudo pip install virtualenv script: + - stty cols 80 + - export COLUMNS=80 - make test - make doc diff --git a/test/toc-autofit.vader b/test/toc-autofit.vader index 005a13f..166cc81 100644 --- a/test/toc-autofit.vader +++ b/test/toc-autofit.vader @@ -1,12 +1,5 @@ " Tests toc window auto-fit to longest header, but without exceeding half screen. -Before: - source ../after/ftplugin/markdown.vim - -After: - setlocal foldexpr=0 - setlocal foldmethod=manual - Given markdown; # chap 1 @@ -50,8 +43,10 @@ Execute (toc window autofit width): let line = '###### chap 12.1.1.1.1.1' AssertEqual getline('33'), line :Toc + let real_width = &winwidth + :lclose let expected_width = len(line) + 2*5 + 1 + 3 - 7 - AssertEqual &winwidth, expected_width + AssertEqual real_width, expected_width " 2 spaces * 5 additional header levels + 1 space for first header + " 3 spaces for line numbers - 7 chars ('###### ') that don't show up on the TOC