From b00bf05feaa0fed4ccaf201c083f29ad71e92f5a Mon Sep 17 00:00:00 2001 From: Dianne Skoll Date: Tue, 11 Oct 2022 09:14:47 -0400 Subject: [PATCH] Add test for %{custom} substitution. --- tests/test-rem | 2 +- tests/test.cmp | 38 +++++++++++++++++++++++++++++++++++--- tests/test.rem | 6 ++++++ 3 files changed, 42 insertions(+), 4 deletions(-) diff --git a/tests/test-rem b/tests/test-rem index 44ce2441..8032dc9a 100644 --- a/tests/test-rem +++ b/tests/test-rem @@ -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 diff --git a/tests/test.cmp b/tests/test.cmp index 22bc2a52..3b7793ae 100644 --- a/tests/test.cmp +++ b/tests/test.cmp @@ -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 diff --git a/tests/test.rem b/tests/test.rem index f2065ce5..e2a85b75 100644 --- a/tests/test.rem +++ b/tests/test.rem @@ -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