From a211159069a68ab78d2e646988ea929b3210ccae Mon Sep 17 00:00:00 2001 From: "Andy K. Massimino" Date: Sat, 9 Oct 2021 13:16:53 -0400 Subject: [PATCH] Fix where test --- test/new/test-where/Makefile | 1 - test/new/test-where/test.vim | 27 ++++++++++++++++++++++----- test/new/test-where/test1.good | 2 +- test/new/test-where/test2.good | 2 +- 4 files changed, 24 insertions(+), 8 deletions(-) diff --git a/test/new/test-where/Makefile b/test/new/test-where/Makefile index 5748c84..b434333 100644 --- a/test/new/test-where/Makefile +++ b/test/new/test-where/Makefile @@ -7,4 +7,3 @@ export INMAKE test: $(MYVIM) -u test.vim - rm *.out diff --git a/test/new/test-where/test.vim b/test/new/test-where/test.vim index ce24b19..9854519 100644 --- a/test/new/test-where/test.vim +++ b/test/new/test-where/test.vim @@ -1,24 +1,41 @@ set nocompatible source ../common/bootstrap.vim +if !has('nvim') + echo 'skipping test-where for vim' + call matchup#test#finished() +endif + +set encoding=utf-8 columns=120 +NoMatchParen + edit +161 normal.c +if matchup#ts_engine#is_enabled(bufnr('.')) + " TODO: matchparen.vim: if empty(a:offscreen.links.close.match) + echo 'skipping test-where for tree_sitter' + call matchup#test#finished() +endif + redir! > test1.out sil MatchupWhereAmI? + sleep 50m redir END +normal! j redir! > test2.out - normal! j sil MatchupWhereAmI? + sleep 50m redir END +normal! k redir! > test3.out - normal! k sil MatchupWhereAmI?? + sleep 50m redir END -call assert_equal(readfile('test1.out'), readfile('test1.good')) -call assert_equal(readfile('test2.out'), readfile('test2.good')) -call assert_equal(readfile('test3.out'), readfile('test3.good')) +call assert_equal(readfile('test1.good'), readfile('test1.out')) +call assert_equal(readfile('test2.good'), readfile('test2.out')) +call assert_equal(readfile('test3.good'), readfile('test3.out')) call matchup#test#finished() diff --git a/test/new/test-where/test1.good b/test/new/test-where/test1.good index 67f722f..cef2859 100644 --- a/test/new/test-where/test1.good +++ b/test/new/test-where/test1.good @@ -1 +1 @@ -match-up: loading...normal_cmd( … { ▶ if (!(VIsual … { ▶ while ( ( … { ▶ if (ctrl_w) … { +match-up: loading...normal_cmd( … { ▶ if (!(VIsual_active && … { ▶ while ( (c >= '1' & … { ▶ if (ctrl_w) … { \ No newline at end of file diff --git a/test/new/test-where/test2.good b/test/new/test-where/test2.good index 784bab3..cef2859 100644 --- a/test/new/test-where/test2.good +++ b/test/new/test-where/test2.good @@ -1 +1 @@ -match-up: loading...normal_cmd( … { ▶ if (!(VIsual … { ▶ while ( ( … { ▶ if (ctrl_w) … { \ No newline at end of file +match-up: loading...normal_cmd( … { ▶ if (!(VIsual_active && … { ▶ while ( (c >= '1' & … { ▶ if (ctrl_w) … { \ No newline at end of file