[Ttssh2-commit] [6354] テスト用スクリプトを登録

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2016年 3月 29日 (火) 17:50:13 JST


Revision: 6354
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/6354
Author:   maya
Date:     2016-03-29 17:50:13 +0900 (Tue, 29 Mar 2016)
Log Message:
-----------
テスト用スクリプトを登録

Added Paths:
-----------
    trunk/tests/256colors2.pl
    trunk/tests/ansi.sh
    trunk/tests/colortable16.sh
    trunk/tests/decfont.pl

-------------- next part --------------
Added: trunk/tests/256colors2.pl
===================================================================
--- trunk/tests/256colors2.pl	                        (rev 0)
+++ trunk/tests/256colors2.pl	2016-03-29 08:50:13 UTC (rev 6354)
@@ -0,0 +1,63 @@
+#!/usr/bin/perl
+# Author: Todd Larason <jtl****@moleh*****>
+# $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";

Added: trunk/tests/ansi.sh
===================================================================
--- trunk/tests/ansi.sh	                        (rev 0)
+++ trunk/tests/ansi.sh	2016-03-29 08:50:13 UTC (rev 6354)
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+printf "\\033[0m\n"
+i=30
+while [ $i -lt 38 ]; do
+  j=40
+  while [ $j -lt 48 ]; do
+    printf "\\033[${i};${j}m Forward:%d Back:%d \\033[0m " $i $j
+      for k in 1 4 5 7; do
+        printf "\\033[${i};${j};${k}m decolate:%d \\033[0m " $k
+        k=$(($k+1))
+      done
+    echo ""
+    j=$(($j+1))
+  done
+  i=$(($i+1))
+done

Added: trunk/tests/colortable16.sh
===================================================================
--- trunk/tests/colortable16.sh	                        (rev 0)
+++ trunk/tests/colortable16.sh	2016-03-29 08:50:13 UTC (rev 6354)
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+# prints a color table of 8bg * 8fg * 2 states (regular/bold)
+echo
+echo Table for 16-color terminal escape sequences.
+echo Replace ESC with \\033 in bash.
+echo
+echo "Background | Foreground colors"
+echo "---------------------------------------------------------------------"
+for((bg=40;bg<=47;bg++)); do
+	for((bold=0;bold<=1;bold++)) do
+		echo -en "\033[0m"" ESC[${bg}m   | "
+		for((fg=30;fg<=37;fg++)); do
+			if [ $bold == "0" ]; then
+				echo -en "\033[${bg}m\033[${fg}m [${fg}m  "
+			else
+				echo -en "\033[${bg}m\033[1;${fg}m [1;${fg}m"
+			fi
+		done
+		echo -e "\033[0m"
+	done
+	echo "--------------------------------------------------------------------- "
+done
+
+echo
+echo

Added: trunk/tests/decfont.pl
===================================================================
--- trunk/tests/decfont.pl	                        (rev 0)
+++ trunk/tests/decfont.pl	2016-03-29 08:50:13 UTC (rev 6354)
@@ -0,0 +1,18 @@
+#!/usr/bin/perl
+
+$ESC=sprintf("%c", 0x1b);
+$ST = $ESC . '(0';
+$ED = $ESC . '(B';
+
+for ($i=95;$i<=126;$i++) {
+#	print $ESC.'(0'.$i."\n";
+}
+print $ST;
+print "_\\abcdefghijklmnopqrstuvwxyz{|}~\n";
+print "\n";
+print "lqqqwqqqk\n";
+print "x { x } x\n";
+print "tqqqnqqqu\n";
+print "x" . $ED . " A " . $ST . "x" . $ED . " % " . $ST . "x\n";
+print "mqqqvqqqj\n";
+print $ED;



Ttssh2-commit メーリングリストの案内
Back to archive index