mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-16 06:18:47 +02:00
Add tests for ansicolors function and new $Use...Colors variables.
This commit is contained in:
@@ -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
11
tests/ansicolors.rem
Normal 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]
|
||||
@@ -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
|
||||
|
||||
|
||||
195
tests/test.cmp
195
tests/test.cmp
@@ -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(B[37;1mBright[0m (0x(B (0x(B (0x(B (0x(B (0x(B
|
||||
(0x(B (0x(B (0x(B[37;1mWhite[0m (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 [32;1mgreen[0m, [31;1mred[0m and [34;1mblue[0m text.
|
||||
This is [0;30m[0;42mblack text on a green background[0m
|
||||
This is [0;30mclamped black text[0m
|
||||
This is [37;1mclamped white text[0m
|
||||
|
||||
TerminalBackground is: -1
|
||||
UseVTColors is: 1
|
||||
Use256Colors is: 1
|
||||
UseTrueColors is: 0
|
||||
UseBGVTColors is: 0
|
||||
This is [38;5;10mgreen[0m, [38;5;9mred[0m and [38;5;12mblue[0m text.
|
||||
This is [38;5;0m[48;5;10mblack text on a green background[0m
|
||||
This is [38;5;0mclamped black text[0m
|
||||
This is [38;5;15mclamped white text[0m
|
||||
|
||||
TerminalBackground is: -1
|
||||
UseVTColors is: 1
|
||||
Use256Colors is: 0
|
||||
UseTrueColors is: 1
|
||||
UseBGVTColors is: 0
|
||||
This is [38;2;0;255;0mgreen[0m, [38;2;255;0;0mred[0m and [38;2;0;0;255mblue[0m text.
|
||||
This is [38;2;0;0;0m[48;2;0;255;0mblack text on a green background[0m
|
||||
This is [38;2;0;0;0mclamped black text[0m
|
||||
This is [38;2;255;255;255mclamped white text[0m
|
||||
|
||||
TerminalBackground is: 0
|
||||
UseVTColors is: 1
|
||||
Use256Colors is: 0
|
||||
UseTrueColors is: 0
|
||||
UseBGVTColors is: 0
|
||||
This is [32;1mgreen[0m, [31;1mred[0m and [34;1mblue[0m text.
|
||||
This is [30;1m[0;42mblack text on a green background[0m
|
||||
This is [30;1mclamped black text[0m
|
||||
This is [37;1mclamped white text[0m
|
||||
|
||||
TerminalBackground is: 0
|
||||
UseVTColors is: 1
|
||||
Use256Colors is: 1
|
||||
UseTrueColors is: 0
|
||||
UseBGVTColors is: 0
|
||||
This is [38;5;10mgreen[0m, [38;5;9mred[0m and [38;5;12mblue[0m text.
|
||||
This is [38;5;238m[48;5;10mblack text on a green background[0m
|
||||
This is [38;5;238mclamped black text[0m
|
||||
This is [38;5;15mclamped white text[0m
|
||||
|
||||
TerminalBackground is: 0
|
||||
UseVTColors is: 1
|
||||
Use256Colors is: 0
|
||||
UseTrueColors is: 1
|
||||
UseBGVTColors is: 0
|
||||
This is [38;2;0;255;0mgreen[0m, [38;2;255;0;0mred[0m and [38;2;0;0;255mblue[0m text.
|
||||
This is [38;2;65;65;65m[48;2;0;255;0mblack text on a green background[0m
|
||||
This is [38;2;65;65;65mclamped black text[0m
|
||||
This is [38;2;255;255;255mclamped white text[0m
|
||||
|
||||
TerminalBackground is: 1
|
||||
UseVTColors is: 1
|
||||
Use256Colors is: 0
|
||||
UseTrueColors is: 0
|
||||
UseBGVTColors is: 0
|
||||
This is [32;1mgreen[0m, [31;1mred[0m and [34;1mblue[0m text.
|
||||
This is [0;30m[0;42mblack text on a green background[0m
|
||||
This is [0;30mclamped black text[0m
|
||||
This is [30;1mclamped white text[0m
|
||||
|
||||
TerminalBackground is: 1
|
||||
UseVTColors is: 1
|
||||
Use256Colors is: 1
|
||||
UseTrueColors is: 0
|
||||
UseBGVTColors is: 0
|
||||
This is [38;5;10mgreen[0m, [38;5;9mred[0m and [38;5;12mblue[0m text.
|
||||
This is [38;5;0m[48;5;10mblack text on a green background[0m
|
||||
This is [38;5;0mclamped black text[0m
|
||||
This is [38;5;7mclamped white text[0m
|
||||
|
||||
TerminalBackground is: 1
|
||||
UseVTColors is: 1
|
||||
Use256Colors is: 0
|
||||
UseTrueColors is: 1
|
||||
UseBGVTColors is: 0
|
||||
This is [38;2;0;255;0mgreen[0m, [38;2;255;0;0mred[0m and [38;2;0;0;255mblue[0m text.
|
||||
This is [38;2;0;0;0m[48;2;0;255;0mblack text on a green background[0m
|
||||
This is [38;2;0;0;0mclamped black text[0m
|
||||
This is [38;2;192;192;192mclamped white text[0m
|
||||
|
||||
TerminalBackground is: -1
|
||||
UseVTColors is: 1
|
||||
Use256Colors is: 0
|
||||
UseTrueColors is: 0
|
||||
UseBGVTColors is: 1
|
||||
This is [32;1mgreen[0m, [31;1mred[0m and [34;1mblue[0m text.
|
||||
This is [0;30m[0;42mblack text on a green background[0m
|
||||
This is [0;30mclamped black text[0m
|
||||
This is [37;1mclamped white text[0m
|
||||
|
||||
TerminalBackground is: -1
|
||||
UseVTColors is: 1
|
||||
Use256Colors is: 1
|
||||
UseTrueColors is: 0
|
||||
UseBGVTColors is: 1
|
||||
This is [38;5;10mgreen[0m, [38;5;9mred[0m and [38;5;12mblue[0m text.
|
||||
This is [38;5;0m[48;5;10mblack text on a green background[0m
|
||||
This is [38;5;0mclamped black text[0m
|
||||
This is [38;5;15mclamped white text[0m
|
||||
|
||||
TerminalBackground is: -1
|
||||
UseVTColors is: 1
|
||||
Use256Colors is: 0
|
||||
UseTrueColors is: 1
|
||||
UseBGVTColors is: 1
|
||||
This is [38;2;0;255;0mgreen[0m, [38;2;255;0;0mred[0m and [38;2;0;0;255mblue[0m text.
|
||||
This is [38;2;0;0;0m[48;2;0;255;0mblack text on a green background[0m
|
||||
This is [38;2;0;0;0mclamped black text[0m
|
||||
This is [38;2;255;255;255mclamped white text[0m
|
||||
|
||||
TerminalBackground is: 0
|
||||
UseVTColors is: 1
|
||||
Use256Colors is: 0
|
||||
UseTrueColors is: 0
|
||||
UseBGVTColors is: 1
|
||||
This is [32;1mgreen[0m, [31;1mred[0m and [34;1mblue[0m text.
|
||||
This is [30;1m[0;42mblack text on a green background[0m
|
||||
This is [30;1mclamped black text[0m
|
||||
This is [37;1mclamped white text[0m
|
||||
|
||||
TerminalBackground is: 0
|
||||
UseVTColors is: 1
|
||||
Use256Colors is: 1
|
||||
UseTrueColors is: 0
|
||||
UseBGVTColors is: 1
|
||||
This is [38;5;10mgreen[0m, [38;5;9mred[0m and [38;5;12mblue[0m text.
|
||||
This is [38;5;238m[48;5;10mblack text on a green background[0m
|
||||
This is [38;5;238mclamped black text[0m
|
||||
This is [38;5;15mclamped white text[0m
|
||||
|
||||
TerminalBackground is: 0
|
||||
UseVTColors is: 1
|
||||
Use256Colors is: 0
|
||||
UseTrueColors is: 1
|
||||
UseBGVTColors is: 1
|
||||
This is [38;2;0;255;0mgreen[0m, [38;2;255;0;0mred[0m and [38;2;0;0;255mblue[0m text.
|
||||
This is [38;2;65;65;65m[48;2;0;255;0mblack text on a green background[0m
|
||||
This is [38;2;65;65;65mclamped black text[0m
|
||||
This is [38;2;255;255;255mclamped white text[0m
|
||||
|
||||
TerminalBackground is: 1
|
||||
UseVTColors is: 1
|
||||
Use256Colors is: 0
|
||||
UseTrueColors is: 0
|
||||
UseBGVTColors is: 1
|
||||
This is [32;1mgreen[0m, [31;1mred[0m and [34;1mblue[0m text.
|
||||
This is [0;30m[0;42mblack text on a green background[0m
|
||||
This is [0;30mclamped black text[0m
|
||||
This is [30;1mclamped white text[0m
|
||||
|
||||
TerminalBackground is: 1
|
||||
UseVTColors is: 1
|
||||
Use256Colors is: 1
|
||||
UseTrueColors is: 0
|
||||
UseBGVTColors is: 1
|
||||
This is [38;5;10mgreen[0m, [38;5;9mred[0m and [38;5;12mblue[0m text.
|
||||
This is [38;5;0m[48;5;10mblack text on a green background[0m
|
||||
This is [38;5;0mclamped black text[0m
|
||||
This is [38;5;7mclamped white text[0m
|
||||
|
||||
TerminalBackground is: 1
|
||||
UseVTColors is: 1
|
||||
Use256Colors is: 0
|
||||
UseTrueColors is: 1
|
||||
UseBGVTColors is: 1
|
||||
This is [38;2;0;255;0mgreen[0m, [38;2;255;0;0mred[0m and [38;2;0;0;255mblue[0m text.
|
||||
This is [38;2;0;0;0m[48;2;0;255;0mblack text on a green background[0m
|
||||
This is [38;2;0;0;0mclamped black text[0m
|
||||
This is [38;2;192;192;192mclamped white text[0m
|
||||
|
||||
MON WKDAY DAY across year test
|
||||
-(1): Trig = Monday, 3 January, 2000
|
||||
No reminders.
|
||||
Sort Test
|
||||
|
||||
Reference in New Issue
Block a user