diff --git a/src/types.h b/src/types.h index d6fd9397..40765139 100644 --- a/src/types.h +++ b/src/types.h @@ -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 diff --git a/tests/ansicolors.rem b/tests/ansicolors.rem new file mode 100644 index 00000000..505dc9e9 --- /dev/null +++ b/tests/ansicolors.rem @@ -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] diff --git a/tests/test-rem b/tests/test-rem index d9d643ec..f1f1aee6 100644 --- a/tests/test-rem +++ b/tests/test-rem @@ -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 diff --git a/tests/test.cmp b/tests/test.cmp index 93c19aed..2652236b 100644 --- a/tests/test.cmp +++ b/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(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