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:
@@ -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()
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
[38;2;248;248;242m#!/usr/bin/expect -f[0m
|
||||
[38;2;248;248;242m# Expect script detected via expect shebang[0m
|
||||
[38;2;248;248;242mset timeout 30[0m
|
||||
[38;2;248;248;242mspawn ssh user@host[0m
|
||||
[38;2;248;248;242mexpect "password:"[0m
|
||||
[38;2;248;248;242msend "secret\r"[0m
|
||||
[38;2;248;248;242mexpect eof[0m
|
||||
@@ -0,0 +1,7 @@
|
||||
[38;2;248;248;242m#!/usr/bin/env tclsh[0m
|
||||
[38;2;248;248;242m# Tcl script detected via tclsh shebang[0m
|
||||
[38;2;248;248;242mputs "Hello from tclsh"[0m
|
||||
[38;2;248;248;242mset x 42[0m
|
||||
[38;2;248;248;242mif {$x > 0} {[0m
|
||||
[38;2;248;248;242m puts "positive"[0m
|
||||
[38;2;248;248;242m}[0m
|
||||
@@ -0,0 +1,5 @@
|
||||
[38;2;248;248;242m#!/usr/bin/wish[0m
|
||||
[38;2;248;248;242m# Tk script detected via wish shebang[0m
|
||||
[38;2;248;248;242mpackage require Tk[0m
|
||||
[38;2;248;248;242mbutton .b -text "Click" -command {puts "clicked"}[0m
|
||||
[38;2;248;248;242mpack .b[0m
|
||||
Reference in New Issue
Block a user