Add test for %{custom} substitution.

This commit is contained in:
Dianne Skoll
2022-10-11 09:14:47 -04:00
parent 29bd07d4ef
commit b00bf05fea
3 changed files with 42 additions and 4 deletions

View File

@@ -49,7 +49,7 @@ chmod 000 include_dir/04cantread.rem
TEST_GETENV="foo bar baz" ; export TEST_GETENV
echo "Test 1" > ../tests/test.out
echo "" >> ../tests/test.out
../src/remind -e -dxte ../tests/test.rem 16 feb 1991 >> ../tests/test.out 2>&1
../src/remind -e -dxte ../tests/test.rem 16 feb 1991 12:13 >> ../tests/test.out 2>&1
echo "" >> ../tests/test.out
echo "Test 2" >> ../tests/test.out
echo "" >> ../tests/test.out

View File

@@ -2741,7 +2741,7 @@ Variable Value
$DefaultTDelta 0 [0, 1440]
$DeltaOffset 0
$DontFork 0
$DontQueue 0
$DontQueue 1
$DontTrigAts 0
$EndSent ".?!"
$EndSentIg "\"')]}>"
@@ -2876,8 +2876,8 @@ $DontFork => 0
0
msg [$DontQueue]%
../tests/test.rem(479): Trig = Saturday, 16 February, 1991
$DontQueue => 0
0
$DontQueue => 1
1
msg [$DontTrigAts]%
../tests/test.rem(480): Trig = Saturday, 16 February, 1991
$DontTrigAts => 0
@@ -4119,6 +4119,38 @@ This is a very long reminder. It should be wrapped. Will it be
wrapped? I'm interested to see it it's wrapped. Please wrap this, ok?
# Custom substitution sequences
FSET subst_custom(a, d, t) "Custom: a=" + a + "; d=" + d + "; t=" + t
REM MSG Here: %{custom}
../tests/test.rem(844): Trig = Saturday, 16 February, 1991
Entering UserFN subst_custom(0, 1991-02-16, 12:13)
a => 0
"Custom: a=" + 0 => "Custom: a=0"
"Custom: a=0" + "; d=" => "Custom: a=0; d="
d => 1991-02-16
"Custom: a=0; d=" + 1991-02-16 => "Custom: a=0; d=1991-02-16"
"Custom: a=0; d=1991-02-16" + "; t=" => "Custom: a=0; d=1991-02-16; t="
t => 12:13
"Custom: a=0; d=1991-02-16; t=" + 12:13 => "Custom: a=0; d=1991-02-16; t=12:13"
Leaving UserFN subst_custom() => "Custom: a=0; d=1991-02-16; t=12:13"
Here: Custom: a=0; d=1991-02-16; t=12:13
REM MSG There: %*{custom}
../tests/test.rem(845): Trig = Saturday, 16 February, 1991
Entering UserFN subst_custom(1, 1991-02-16, 12:13)
a => 1
"Custom: a=" + 1 => "Custom: a=1"
"Custom: a=1" + "; d=" => "Custom: a=1; d="
d => 1991-02-16
"Custom: a=1; d=" + 1991-02-16 => "Custom: a=1; d=1991-02-16"
"Custom: a=1; d=1991-02-16" + "; t=" => "Custom: a=1; d=1991-02-16; t="
t => 12:13
"Custom: a=1; d=1991-02-16; t=" + 12:13 => "Custom: a=1; d=1991-02-16; t=12:13"
Leaving UserFN subst_custom() => "Custom: a=1; d=1991-02-16; t=12:13"
There: Custom: a=1; d=1991-02-16; t=12:13
# Don't want Remind to queue reminders
EXIT

View File

@@ -838,6 +838,12 @@ OMIT Dec 5 2029 through Dec 4 2029
REM MSF This is a very long reminder. It should be wrapped. Will it be wrapped? I'm interested to see it it's wrapped. Please wrap this, ok?
# Custom substitution sequences
FSET subst_custom(a, d, t) "Custom: a=" + a + "; d=" + d + "; t=" + t
REM MSG Here: %{custom}
REM MSG There: %*{custom}
# Don't want Remind to queue reminders
EXIT