mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-15 23:22:53 +08:00
tests: Move control sequences filtering to fish directly
This was an sh-script that just invoked fish again. I can see how we could implement it in another language to avoid the fish under test corrupting the results, but it literally invoked the fish under test anyway.
This commit is contained in:
parent
8dcde27e0b
commit
2d07aa2686
17
tests/filter-control-sequences.fish
Executable file
17
tests/filter-control-sequences.fish
Executable file
@ -0,0 +1,17 @@
|
||||
#!/usr/bin/fish
|
||||
# Remove the sorts of escape sequences interactive fish prints.
|
||||
|
||||
# First the enable sequences
|
||||
set -l escapes "\e\[\?2004h"\
|
||||
"\e\[>4;1m"\
|
||||
"\e\[>5u"\
|
||||
"\e="\
|
||||
# or
|
||||
"|"\
|
||||
# the disable sequences
|
||||
"\e\[\?2004l"\
|
||||
"\e\[>4;0m"\
|
||||
"\e\[<1u"\
|
||||
"\e>"
|
||||
|
||||
cat | string replace -ra -- $escapes ''
|
@ -1,14 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
escape=$(printf '\033')
|
||||
|
||||
"$1" -c 'cat | string replace -ra $argv[1] ""' -- "\
|
||||
""$escape\[\?2004h""\
|
||||
""$escape\[>4;1m""\
|
||||
""$escape\[>5u""\
|
||||
""$escape=""\
|
||||
""|""\
|
||||
""$escape\[\?2004l""\
|
||||
""$escape\[>4;0m""\
|
||||
""$escape\[<1u""\
|
||||
""$escape>"
|
@ -42,7 +42,7 @@ if set -q files_to_test[1]
|
||||
--progress $force_color \
|
||||
-s fish=../test/root/bin/fish \
|
||||
-s fish_test_helper=../test/root/bin/fish_test_helper \
|
||||
-s filter-control-sequences='../tests/filter-control-sequences.sh ../test/root/bin/fish' \
|
||||
-s filter-control-sequences='../test/root/bin/fish ../tests/filter-control-sequences.fish' \
|
||||
$files_to_test
|
||||
|
||||
set -l littlecheck_status $status
|
||||
|
Loading…
x
Reference in New Issue
Block a user