Add tests for ansicolors function and new $Use...Colors variables.

This commit is contained in:
Dianne Skoll
2022-10-09 12:59:52 -04:00
parent 7218d55f08
commit f3cca092be
4 changed files with 228 additions and 5 deletions

View File

@@ -238,6 +238,6 @@ typedef struct {
/* Pure JSON */
#define PSCAL_LEVEL3 3
#define TERMINAL_BACKGROUND_UNKNOWN 0
#define TERMINAL_BACKGROUND_DARK 1
#define TERMINAL_BACKGROUND_LIGHT 2
#define TERMINAL_BACKGROUND_UNKNOWN -1
#define TERMINAL_BACKGROUND_DARK 0
#define TERMINAL_BACKGROUND_LIGHT 1

11
tests/ansicolors.rem Normal file
View File

@@ -0,0 +1,11 @@
BANNER %
MSG TerminalBackground is: [$TerminalBackground]%
MSG UseVTColors is: [$UseVTColors]%
MSG Use256Colors is: [$Use256Colors]%
MSG UseTrueColors is: [$UseTrueColors]%
MSG UseBGVTColors is: [$UseBGVTColors]%
set n ansicolor("")]
MSG This is [ansicolor(0,255,0)]green[n], [ansicolor("255 0 0")]red[n] and [ansicolor("0 0 255")]blue[n] text.%
MSG This is [ansicolor(0,0,0)][ansicolor(0,255,0,1)]black text on a green background[n]%
MSG This is [ansicolor(0,0,0,0,1)]clamped black text[n]%
MSG This is [ansicolor(255,255,255,0,1)]clamped white text[n]

View File

@@ -95,6 +95,27 @@ echo 'REM Mon 31 2021 MSG [$T]' | ../src/remind -dt - 31 dec 2021 >> ../tests/te
echo "Color Test" >> ../tests/test.out
../src/remind -ccl ../tests/colors.rem 1 aug 2007 >> ../tests/test.out 2>&1
echo "ANSI Color Test" >> ../tests/test.out
../src/remind ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
../src/remind -@0 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
../src/remind -@1 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
../src/remind -@2 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
../src/remind -@0,0 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
../src/remind -@1,0 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
../src/remind -@2,0 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
../src/remind -@0,1 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
../src/remind -@1,1 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
../src/remind -@2,1 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
../src/remind -@0,,1 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
../src/remind -@1,,1 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
../src/remind -@2,,1 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
../src/remind -@0,0,1 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
../src/remind -@1,0,1 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
../src/remind -@2,0,1 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
../src/remind -@0,1,1 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
../src/remind -@1,1,1 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
../src/remind -@2,1,1 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
echo "MON WKDAY DAY across year test" >> ../tests/test.out
echo 'REM Mon 29 Dec MSG x' | ../src/remind -dt - 1 Jan 2000 >> ../tests/test.out 2>&1

View File

@@ -2774,7 +2774,7 @@ Variable Value
$SuppressLRM 0 [0, 1]
$T 0
$Td -1
$TerminalBackground 0
$TerminalBackground -1
$Thursday "Thursday"
$TimeSep ":"
$Tm -1
@@ -5424,7 +5424,198 @@ Color Test
(0x(B (0x(B (0x(BBright (0x(B (0x(B (0x(B (0x(B (0x(B
(0x(B (0x(B (0x(BWhite (0x(B (0x(B (0x(B (0x(B (0x(B
(0mqqqqqqqqqqvqqqqqqqqqqvqqqqqqqqqqvqqqqqqqqqqvqqqqqqqqqqvqqqqqqqqqqvqqqqqqqqqqj(B
MON WKDAY DAY across year test
ANSI Color Test
TerminalBackground is: -1
UseVTColors is: 0
Use256Colors is: 0
UseTrueColors is: 0
UseBGVTColors is: 0
This is green, red and blue text.
This is black text on a green background
This is clamped black text
This is clamped white text
TerminalBackground is: -1
UseVTColors is: 1
Use256Colors is: 0
UseTrueColors is: 0
UseBGVTColors is: 0
This is green, red and blue text.
This is black text on a green background
This is clamped black text
This is clamped white text
TerminalBackground is: -1
UseVTColors is: 1
Use256Colors is: 1
UseTrueColors is: 0
UseBGVTColors is: 0
This is green, red and blue text.
This is black text on a green background
This is clamped black text
This is clamped white text
TerminalBackground is: -1
UseVTColors is: 1
Use256Colors is: 0
UseTrueColors is: 1
UseBGVTColors is: 0
This is green, red and blue text.
This is black text on a green background
This is clamped black text
This is clamped white text
TerminalBackground is: 0
UseVTColors is: 1
Use256Colors is: 0
UseTrueColors is: 0
UseBGVTColors is: 0
This is green, red and blue text.
This is black text on a green background
This is clamped black text
This is clamped white text
TerminalBackground is: 0
UseVTColors is: 1
Use256Colors is: 1
UseTrueColors is: 0
UseBGVTColors is: 0
This is green, red and blue text.
This is black text on a green background
This is clamped black text
This is clamped white text
TerminalBackground is: 0
UseVTColors is: 1
Use256Colors is: 0
UseTrueColors is: 1
UseBGVTColors is: 0
This is green, red and blue text.
This is black text on a green background
This is clamped black text
This is clamped white text
TerminalBackground is: 1
UseVTColors is: 1
Use256Colors is: 0
UseTrueColors is: 0
UseBGVTColors is: 0
This is green, red and blue text.
This is black text on a green background
This is clamped black text
This is clamped white text
TerminalBackground is: 1
UseVTColors is: 1
Use256Colors is: 1
UseTrueColors is: 0
UseBGVTColors is: 0
This is green, red and blue text.
This is black text on a green background
This is clamped black text
This is clamped white text
TerminalBackground is: 1
UseVTColors is: 1
Use256Colors is: 0
UseTrueColors is: 1
UseBGVTColors is: 0
This is green, red and blue text.
This is black text on a green background
This is clamped black text
This is clamped white text
TerminalBackground is: -1
UseVTColors is: 1
Use256Colors is: 0
UseTrueColors is: 0
UseBGVTColors is: 1
This is green, red and blue text.
This is black text on a green background
This is clamped black text
This is clamped white text
TerminalBackground is: -1
UseVTColors is: 1
Use256Colors is: 1
UseTrueColors is: 0
UseBGVTColors is: 1
This is green, red and blue text.
This is black text on a green background
This is clamped black text
This is clamped white text
TerminalBackground is: -1
UseVTColors is: 1
Use256Colors is: 0
UseTrueColors is: 1
UseBGVTColors is: 1
This is green, red and blue text.
This is black text on a green background
This is clamped black text
This is clamped white text
TerminalBackground is: 0
UseVTColors is: 1
Use256Colors is: 0
UseTrueColors is: 0
UseBGVTColors is: 1
This is green, red and blue text.
This is black text on a green background
This is clamped black text
This is clamped white text
TerminalBackground is: 0
UseVTColors is: 1
Use256Colors is: 1
UseTrueColors is: 0
UseBGVTColors is: 1
This is green, red and blue text.
This is black text on a green background
This is clamped black text
This is clamped white text
TerminalBackground is: 0
UseVTColors is: 1
Use256Colors is: 0
UseTrueColors is: 1
UseBGVTColors is: 1
This is green, red and blue text.
This is black text on a green background
This is clamped black text
This is clamped white text
TerminalBackground is: 1
UseVTColors is: 1
Use256Colors is: 0
UseTrueColors is: 0
UseBGVTColors is: 1
This is green, red and blue text.
This is black text on a green background
This is clamped black text
This is clamped white text
TerminalBackground is: 1
UseVTColors is: 1
Use256Colors is: 1
UseTrueColors is: 0
UseBGVTColors is: 1
This is green, red and blue text.
This is black text on a green background
This is clamped black text
This is clamped white text
TerminalBackground is: 1
UseVTColors is: 1
Use256Colors is: 0
UseTrueColors is: 1
UseBGVTColors is: 1
This is green, red and blue text.
This is black text on a green background
This is clamped black text
This is clamped white text
MON WKDAY DAY across year test
-(1): Trig = Monday, 3 January, 2000
No reminders.
Sort Test