[add more test scripts
John Meacham <john@repetae.net>**20050724141437] {
addfile ./tests/256colors2.pl
hunk ./tests/256colors2.pl 1
+#!/usr/bin/perl
+# Author: Todd Larason <jtl@molehill.org>
+# $XFree86: xc/programs/xterm/vttests/256colors2.pl,v 1.2 2002/03/26 01:46:43 dickey Exp $
+
+# use the resources for colors 0-15 - usually more-or-less a
+# reproduction of the standard ANSI colors, but possibly more
+# pleasing shades
+
+# colors 16-231 are a 6x6x6 color cube
+for ($red = 0; $red < 6; $red++) {
+    for ($green = 0; $green < 6; $green++) {
+	for ($blue = 0; $blue < 6; $blue++) {
+	    printf("\x1b]4;%d;rgb:%2.2x/%2.2x/%2.2x\x1b\\",
+		   16 + ($red * 36) + ($green * 6) + $blue,
+		   ($red ? ($red * 40 + 55) : 0),
+		   ($green ? ($green * 40 + 55) : 0),
+		   ($blue ? ($blue * 40 + 55) : 0));
+	}
+    }
+}
+
+# colors 232-255 are a grayscale ramp, intentionally leaving out
+# black and white
+for ($gray = 0; $gray < 24; $gray++) {
+    $level = ($gray * 10) + 8;
+    printf("\x1b]4;%d;rgb:%2.2x/%2.2x/%2.2x\x1b\\",
+	   232 + $gray, $level, $level, $level);
+}
+
+
+# display the colors
+
+# first the system ones:
+print "System colors:\n";
+for ($color = 0; $color < 8; $color++) {
+    print "\x1b[48;5;${color}m  ";
+}
+print "\x1b[0m\n";
+for ($color = 8; $color < 16; $color++) {
+    print "\x1b[48;5;${color}m  ";
+}
+print "\x1b[0m\n\n";
+
+# now the color cube
+print "Color cube, 6x6x6:\n";
+for ($green = 0; $green < 6; $green++) {
+    for ($red = 0; $red < 6; $red++) {
+	for ($blue = 0; $blue < 6; $blue++) {
+	    $color = 16 + ($red * 36) + ($green * 6) + $blue;
+	    print "\x1b[48;5;${color}m  ";
+	}
+	print "\x1b[0m ";
+    }
+    print "\n";
+}
+
+
+# now the grayscale ramp
+print "Grayscale ramp:\n";
+for ($color = 232; $color < 256; $color++) {
+    print "\x1b[48;5;${color}m  ";
+}
+print "\x1b[0m\n";
addfile ./tests/acolors.sh
hunk ./tests/acolors.sh 1
+#!/bin/sh
+# $XFree86: xc/programs/xterm/vttests/acolors.sh,v 1.2 2003/05/19 00:52:30 dickey Exp $
+#
+# -- Thomas Dickey (1999/3/27)
+# Demonstrate the use of the control sequence for changing ANSI colors.
+
+ESC=""
+CMD='echo'
+OPT='-n'
+SUF=''
+TMP=/tmp/xterm$$
+eval '$CMD $OPT >$TMP || echo fail >$TMP' 2>/dev/null
+( test ! -f $TMP || test -s $TMP ) &&
+for verb in printf print ; do
+    rm -f $TMP
+    eval '$verb "\c" >$TMP || echo fail >$TMP' 2>/dev/null
+    if test -f $TMP ; then
+	if test ! -s $TMP ; then
+	    CMD="$verb"
+	    OPT=
+	    SUF='\c'
+	    break
+	fi
+    fi
+done
+rm -f $TMP
+
+LIST="00 30 80 d0 ff"
+
+exec </dev/tty
+old=`stty -g`
+stty raw -echo min 0  time 5
+
+$CMD $OPT "${ESC}]4;4;?${SUF}" > /dev/tty
+read original
+stty $old
+original=${original}${SUF}
+
+if ( trap "echo exit" EXIT 2>/dev/null ) >/dev/null
+then
+    trap '$CMD $OPT "$original" >/dev/tty; exit' EXIT HUP INT TRAP TERM
+else
+    trap '$CMD $OPT "$original" >/dev/tty; exit' 0    1   2   5    15
+fi
+
+$CMD "${ESC}[0;1;34mThis message is BLUE"
+$CMD "${ESC}[0;1;31mThis message is RED ${ESC}[0;31m(sometimes)"
+$CMD "${ESC}[0;1;32mThis message is GREEN${ESC}[0m"
+while true
+do
+    for R in $LIST
+    do
+	for G in $LIST
+	do
+	    for B in $LIST
+	    do
+		# color "9" is bold-red
+		test $R != 00 && test $G = 00 && test $B = 00 && $CMD $OPT "" >/dev/tty
+		$CMD $OPT "${ESC}]4;9;rgb:$R/$G/$B${SUF}" >/dev/tty
+		sleep 1
+	    done
+	done
+    done
+done
addfile ./tests/demo.utf
hunk ./tests/demo.utf 1
+∙ Why use :-) when you can use ☺?
+∙ Gøëring, Garçon
+∙ Γαρη Ξαπελλ
+∙ ∀x ∃y : ½y ≧ x²
+∙ ♘♙♚♜♝♞♟♠♡♢♣♤♥♦♧♩♪♭♮♯
+∙ ЙКЛ МОП РСУФХЦЧШЩЪЫЬЭЯабвг
+∙ ひびぴふぶぷへべ ぺみむめもゃやゅゆょよるゎゐァイキ
+∙ ∴ Use Wily
addfile ./tests/test.utf
hunk ./tests/test.utf 1
+************ Hungarian - Magyar ****************
+A tanyákon túl a puszta mélyén
+Áll magányos, dőlt kéményű csárda;
+Látogatják a szomjas betyárok,
+Kecskemétre menvén a vásárra.
+************ Russian - Русский ************
+Следователь. Вы догадываетесь, почему вас вызвали?
+Свидетель. Да, но лучше будет, если вы скажете.
+Следователь. Почему лучше?
+Свидетель. В противном случае получается, что вам стыдно сказать.
+(Из рассказов о допросе.)
+************ Greek - ΕΛΛΗΝΙΚΑ ****************
+Στο στήθος μου η πληγή ανοίγει πάλι
+όταν χαμηλώνουν τ' άστρα και συγγενεύουν με το κορμί μου
+όταν πέφτει σιγή κάτω από τα πέλματα των ανθρώπων.
+Αυτές οι πέτρες που βουλιάζουν μέσα στα χρόνια ως πού θα με παρασύρουν;
+Τη θάλασσα τη θάλασσα, ποιός θα μπορέσει να την εξαντλήσει;
+**************** Japanese 日本語 ****************
+人妻ゆゑに　我恋ひめやも 紫のにほへる妹を憎くあらば
+大海人皇子　巻一｜二十一 
+野守は見ずや　君が袖振る あかねさす　紫野行き　標野行き
+額田王　巻一｜二十 
+**************** Chinese 中文 ****************
+古原草　　　　　白居易
+离离原上草，一岁一枯荣。
+野火烧不尽，春风吹又生。
+远芳侵古道，晴翠接荒城。
+又送王孙去，萋萋满别情。
+***************** Korean 한국어 ************************
+ 별     :  김남주
+밤 들어 세상은/온통 고요한데/그리워 못 잊어 홀로 잠 못 이뤄
+불 밝혀 지새우는 것이 있다./사람들은 그것을 별이라 그런다.
+기약이라 소망이라 그런다./밤 깊어/가장 괴로울 때면
+사람들은 저마다 별이 되어/어머니 어머니라 부른다.
}
