Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreMarchand20 committed Dec 9, 2023
1 parent 883d547 commit 083a25d
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 52 deletions.
6 changes: 3 additions & 3 deletions tests/reference_output/backward_search.cast
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ $ touch my_first_file.txt
$ touch my_second_file.txt
$ rm my_first_file.txt
$
(reverse-i-search)`': t': rm my_first_file.txt
(reverse-i-search)`to': touch my_second_file.txt[1@u': tou[1@c': touc[1@h': touchtouch my_first
$ touch
(reverse-i-search)`': t': rm my_first_file.txt
(reverse-i-search)`to': touch my_second_file.txtu': touc': touch': touchtouch my_first
$ touch
$
$ ls my_first_file.txt
my_first_file.txt
Expand Down
4 changes: 2 additions & 2 deletions tests/reference_output/history.cast
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ $ touch my_first_file.txt
$ touch my_second_file.txt
$ rm my_first_file.txt
$ rm my_first_file.txt
$ [4@touch my_second_file.txt
$ touch my_first_file.txt
$ touch my_second_file.txt
$ touch my_first_file.txt
$ ls
my_first_file.txt my_second_file.txt
$ exit
92 changes: 46 additions & 46 deletions tests/reference_output/man_page.cast
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
$ man echo
[?1049h[?1h=
ECHO(1) User Commands ECHO(1)

NAME
echo - display a line of text

SYNOPSIS
echo [SHORT-OPTION]... [STRING]...
echo LONG-OPTION

DESCRIPTION
Echo the STRING(s) to standard output.

-n do not output the trailing newline

-e enable interpretation of backslash escapes

-E disable interpretation of backslash escapes (default)

--help display this help and exit

--version
output version information and exit

 Manual page echo(1) line 1 (press h for help or q to quit)
 ESCESC[[BB
 Manual page echo(1) line 1 (press h for help or q to quit)
 If -e is in effect, the following sequences are recognized:
 Manual page echo(1) line 2 (press h for help or q to quit)
 ESCESC[[BB
 Manual page echo(1) line 2 (press h for help or q to quit)

 Manual page echo(1) line 3 (press h for help or q to quit)
 ESCESC[[BB
 Manual page echo(1) line 3 (press h for help or q to quit)
 \\ backslash
 Manual page echo(1) line 4 (press h for help or q to quit)
 ESCESC[[BB
 Manual page echo(1) line 4 (press h for help or q to quit)

 Manual page echo(1) line 5 (press h for help or q to quit)
 ESCESC[[BB
 Manual page echo(1) line 5 (press h for help or q to quit)
 \a alert (BEL)
 Manual page echo(1) line 6 (press h for help or q to quit)
[?1l>[?1049l$ exit
=
ECHO(1) User Commands ECHO(1)

NAME
echo - display a line of text

SYNOPSIS
echo [SHORT-OPTION]... [STRING]...
echo LONG-OPTION

DESCRIPTION
Echo the STRING(s) to standard output.

-n do not output the trailing newline

-e enable interpretation of backslash escapes

-E disable interpretation of backslash escapes (default)

--help display this help and exit

--version
output version information and exit

Manual page echo(1) line 1 (press h for help or q to quit)
ESCESC[[BB
Manual page echo(1) line 1 (press h for help or q to quit)
If -e is in effect, the following sequences are recognized:
Manual page echo(1) line 2 (press h for help or q to quit)
ESCESC[[BB
Manual page echo(1) line 2 (press h for help or q to quit)

Manual page echo(1) line 3 (press h for help or q to quit)
ESCESC[[BB
Manual page echo(1) line 3 (press h for help or q to quit)
\\ backslash
Manual page echo(1) line 4 (press h for help or q to quit)
ESCESC[[BB
Manual page echo(1) line 4 (press h for help or q to quit)

Manual page echo(1) line 5 (press h for help or q to quit)
ESCESC[[BB
Manual page echo(1) line 5 (press h for help or q to quit)
\a alert (BEL)
Manual page echo(1) line 6 (press h for help or q to quit)
>$ exit
4 changes: 3 additions & 1 deletion tests/test_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ def test_regression(tmp_path, request, inputfile: pathlib.Path):

with open(output_folder / output_file_name, "r") as output_file:
with pathlib.Path(reference_folder / output_file_name).open() as reference_file:
ansi_escape = re.compile(r"\x1b(.*?)t", re.VERBOSE)
ansi_escape = re.compile(
r"\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])", re.VERBOSE
)
output_text = output_file.read()
cleaned_output_text = ansi_escape.sub("", output_text)
assert cleaned_output_text == reference_file.read()

0 comments on commit 083a25d

Please sign in to comment.