From 40ddb23b103eb1d29d2aa0ae3e5bc6633bae9c93 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 28 Mar 2019 19:39:16 -0400 Subject: color: Implement escape sequence parsing GNU ls allows custom escape sequences inside color values, including control characters and embedded NULs. --- tests.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests.sh') diff --git a/tests.sh b/tests.sh index bd3f399..187daff 100755 --- a/tests.sh +++ b/tests.sh @@ -626,6 +626,8 @@ bfs_tests=( test_color test_color_L + test_color_rs_lc_rc_ec + test_color_escapes test_color_mh test_color_mh0 test_color_or @@ -1847,6 +1849,14 @@ function test_color_L() { LS_COLORS= bfs_diff -L rainbow -color } +function test_color_rs_lc_rc_ec() { + LS_COLORS="rs=RS:lc=LC:rc=RC:ec=EC:" bfs_diff rainbow -color +} + +function test_color_escapes() { + LS_COLORS="lc=\e[:rc=\x6d\::ec=^[[\x6D\0:" bfs_diff rainbow -color +} + function test_color_mh() { LS_COLORS="mh=01:" bfs_diff rainbow -color } -- cgit v1.2.3