1
0
mirror of https://github.com/sharkdp/bat synced 2026-06-09 10:03:18 +00:00

test: add highlighted outputs for Tcl shebang regression tests

Generate highlighted test outputs for tclsh, wish, and expect
shebang detection files to prevent regressions.
This commit is contained in:
Matt Van Horn
2026-03-27 12:18:30 -07:00
parent e070d105b5
commit cafad6b036
5 changed files with 21 additions and 4 deletions
-4
View File
@@ -8,11 +8,7 @@
## Features
<<<<<<< HEAD
- Preserve `--diff` change markers and snip separators when `--plain` is set. Closes #3630, see #3643 (@mvanhorn)
- Add shebang-based detection for Tcl (`tclsh`, `wish`) and Expect (`expect`) scripts, see #3647 (@mvanhorn)
=======
>>>>>>> 29c913f (test: add shebang regression tests and move changelog to Syntaxes section)
- Added support for `hidden_file_extensions` from `.sublime-syntax` files, see #3613 (@Matei02355)
- Add word wrapping mode via `--wrap=word`, see #3597 (@veeceey)
- Support configuring `--terminal-width` via `BAT_WIDTH`, see #3679 (@officialasishkumar)
+2
View File
@@ -4201,6 +4201,8 @@ fn plain_without_diff_still_works() {
.assert()
.success()
.stdout("line 1\nline 2 modified\nline 3\nline 4 added\n");
}
#[test]
fn tcl_shebang_detection_tclsh() {
bat()
+7
View File
@@ -0,0 +1,7 @@
#!/usr/bin/expect -f
# Expect script detected via expect shebang
set timeout 30
spawn ssh user@host
expect "password:"
send "secret\r"
expect eof
+7
View File
@@ -0,0 +1,7 @@
#!/usr/bin/env tclsh
# Tcl script detected via tclsh shebang
puts "Hello from tclsh"
set x 42
if {$x > 0} {
 puts "positive"
}
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/wish
# Tk script detected via wish shebang
package require Tk
button .b -text "Click" -command {puts "clicked"}
pack .b