mirror of
https://github.com/ascii-boxes/boxes.git
synced 2025-01-20 20:58:35 +01:00
Add test cases for colored unicode 'headline' design #1
This design uses complex regular expressions, which must work on unicode characters.
This commit is contained in:
parent
eb5ac9c701
commit
12fa4ea57e
@ -1883,8 +1883,7 @@ reverse "^ " to " "
|
||||
reverse "((?:\x1b\[[0-9;]*m)*(?!\x1b).) " to "$1"
|
||||
|
||||
padding {
|
||||
left 2
|
||||
right 1
|
||||
horizontal 2
|
||||
}
|
||||
|
||||
elastic (n,e,s,w)
|
||||
|
10
test/112_headline_ansi_unicode.txt
Normal file
10
test/112_headline_ansi_unicode.txt
Normal file
@ -0,0 +1,10 @@
|
||||
:ARGS
|
||||
-n UTF-8 -d headline -p l3r1
|
||||
:INPUT
|
||||
[38;5;44m [0m[38;5;44m [0m[38;5;44m [0m[38;5;44mf[0m[38;5;49mo[0m[38;5;48mo[0m[38;5;83m [0m[38;5;118m海[0m[38;5;154m [0m[38;5;184mb[0m[38;5;214ma[0m[38;5;208mr[0m
|
||||
:OUTPUT-FILTER
|
||||
:EXPECTED
|
||||
/**************************/
|
||||
/* [38;5;44mf [0m[38;5;49mo [0m[38;5;48mo [0m[38;5;83m [0m[38;5;118m海 [0m[38;5;154m [0m[38;5;184mb [0m[38;5;214ma [0m[38;5;208mr [0m */
|
||||
/**************************/
|
||||
:EOF
|
16
test/113_headline_ansi_unicode_remove.txt
Normal file
16
test/113_headline_ansi_unicode_remove.txt
Normal file
@ -0,0 +1,16 @@
|
||||
:DESC
|
||||
Tests removal of a box of the 'headline' design from unicode text with ANSI color escapes added by lolcat.
|
||||
Indentation is restored, by "coloring" of spaces is lost.
|
||||
Indentation is correctly restored as 3 spaces, because we give -p, telling it what the requested padding was when the
|
||||
box was created.
|
||||
|
||||
:ARGS
|
||||
-d headline -p l3r2 -r
|
||||
:INPUT
|
||||
/**************************/
|
||||
/* [38;5;44mf [0m[38;5;49mo [0m[38;5;48mo [0m[38;5;83m [0m[38;5;118m海 [0m[38;5;154m [0m[38;5;184mb [0m[38;5;214ma [0m[38;5;208mr [0m */
|
||||
/**************************/
|
||||
:OUTPUT-FILTER
|
||||
:EXPECTED
|
||||
[38;5;44mf[0m[38;5;49mo[0m[38;5;48mo[0m[38;5;83m [0m[38;5;118m海[0m[38;5;154m [0m[38;5;184mb[0m[38;5;214ma[0m[38;5;208mr[0m
|
||||
:EOF
|
@ -1,11 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Low-tech test runner for boxes.
|
||||
# boxes - Command line filter to draw/remove ASCII boxes around text
|
||||
# Copyright (C) 1999 Thomas Jensen and the boxes contributors
|
||||
#
|
||||
# File: testrunner.sh
|
||||
# Date created: September 23, 2014 (Tuesday, 20:06h)
|
||||
# Author: Thomas Jensen
|
||||
# _____________________________________________________________________
|
||||
# This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
|
||||
# License, version 2, as published by the Free Software Foundation.
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
# You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
|
||||
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
# _____________________________________________________________________________________________________________________
|
||||
#
|
||||
# Low-tech test runner for boxes.
|
||||
# _____________________________________________________________________________________________________________________
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo 'Usage: testrunner.sh {-suite | <testCaseFile>}'
|
||||
|
Loading…
Reference in New Issue
Block a user