From 1037ce2e461034a20e35ad59969fd05d5ad68b91 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 9 Dec 2023 20:42:00 +0800 Subject: test: avoid repeated screen lines in expected states This is the command invoked repeatedly to make the changes: :%s/^\(.*\)|\%(\*\(\d\+\)\)\?$\n\1|\%(\*\(\d\+\)\)\?$/\=submatch(1)..'|*'..(max([str2nr(submatch(2)),1])+max([str2nr(submatch(3)),1]))/g --- test/functional/ex_cmds/map_spec.lua | 43 +++++++++--------------------------- 1 file changed, 11 insertions(+), 32 deletions(-) (limited to 'test/functional/ex_cmds/map_spec.lua') diff --git a/test/functional/ex_cmds/map_spec.lua b/test/functional/ex_cmds/map_spec.lua index a580e88b93..c8855337ef 100644 --- a/test/functional/ex_cmds/map_spec.lua +++ b/test/functional/ex_cmds/map_spec.lua @@ -105,25 +105,19 @@ describe('Screen', function() command('map x input("> ")') screen:expect([[ ^ | - ~ | - ~ | - ~ | + ~ |*3 | ]]) feed('x') screen:expect([[ | - ~ | - ~ | - ~ | + ~ |*3 > ^ | ]]) feed('\n') screen:expect([[ ^ | - ~ | - ~ | - ~ | + ~ |*3 > | ]]) end) @@ -133,25 +127,19 @@ describe('Screen', function() feed('i') screen:expect([[ ^ | - ~ | - ~ | - ~ | + ~ |*3 -- INSERT -- | ]]) feed('x') screen:expect([[ | - ~ | - ~ | - ~ | + ~ |*3 > ^ | ]]) feed('\n') screen:expect([[ ^ | - ~ | - ~ | - ~ | + ~ |*3 -- INSERT -- | ]]) end) @@ -161,9 +149,7 @@ describe('Screen', function() feed(':') screen:expect([[ | - ~ | - ~ | - ~ | + ~ |*3 :^ | ]]) end) @@ -201,8 +187,7 @@ describe('Screen', function() command('nmap execute("throw 42")') feed('') screen:expect([[ - | - | + |*2 Error detected while processing : | E605: Exception not caught: 42 | Press ENTER or type command to continue^ | @@ -210,9 +195,7 @@ describe('Screen', function() feed('') screen:expect([[ ^ | - ~ | - ~ | - ~ | + ~ |*3 | ]]) end) @@ -223,9 +206,7 @@ describe('Screen', function() feed(':echo "foo') screen:expect([[ | - ~ | - ~ | - ~ | + ~ |*3 :echo "foo^ | ]]) feed('') @@ -261,9 +242,7 @@ describe('Screen', function() feed(': nmap a') screen:expect([[ ^ | - ~ | - ~ | - ~ | + ~ |*3 n a b | ]]) end) -- cgit