groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 16/21: [troff]: Add more tests of arithmetic.


From: G. Branden Robinson
Subject: [groff] 16/21: [troff]: Add more tests of arithmetic.
Date: Thu, 25 Jul 2024 17:10:25 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit a7687009739feb5592f33de6e6a3573bae7fc349
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Thu Jul 25 08:22:33 2024 -0500

    [troff]: Add more tests of arithmetic.
    
    * src/roff/groff/tests/arithmetic-works.sh: Add more tests.
    
    Test fails at this commit.
---
 ChangeLog                                |  4 ++++
 src/roff/groff/tests/arithmetic-works.sh | 33 +++++++++++++++++++++++++-------
 2 files changed, 30 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 88d6cd3be..a99a5f3fe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2024-07-25  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * src/roff/groff/tests/arithmetic-works.sh: Add more tests.
+
 2024-07-25  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * src/roff/troff/number.cpp (vunits::vunits, hunits::hunits):
diff --git a/src/roff/groff/tests/arithmetic-works.sh 
b/src/roff/groff/tests/arithmetic-works.sh
index 3f0b91701..c188ca867 100755
--- a/src/roff/groff/tests/arithmetic-works.sh
+++ b/src/roff/groff/tests/arithmetic-works.sh
@@ -39,25 +39,44 @@ wail () {
 input='.
 .ec @
 .nf
-.vs +2
-@&.v=@n(.v
+.vs +40u
+1: @&.v=@n(.v
 .ll -2
-@&.l=@n(.l
+2: @&.l=@n(.l
+.ll 2147483647u
+3: @&.l=@n(.l, .H=@n(.H
+.ll
+.pl 2147483647u
+4: @&.p=@n(.p, .V=@n(.V
+.pl
 .'
 
 # Expected:
 #
-# .v=40
-# .l=1512
+# 1: .v=80
+#
+# 2: .l=1512
+#
+# 3: .l=24, .H=24
+#
+# 4: .p=40, .V=40
+#
+# The blank lines are due to the `vs` increase.
 
 output=$(echo "$input" | "$groff" -T ascii)
 echo "$output"
 
 echo "checking that vertical spacing is correctly incremented" >&2
-echo "$output" | grep -Fqx '.l=1512' || wail
+echo "$output" | grep -Fqx '1: .v=80' || wail
 
 echo "checking that line length is correctly incremented" >&2
-echo "$output" | grep -Fqx '.l=1512' || wail
+echo "$output" | grep -Fqx '2: .l=1512' || wail
+
+echo "checking that setting huge line length does not overflow" >&2
+echo "$output" | grep -Fqx '3: .l=24, .H=24' || wail
+
+echo "checking that setting huge page length does not overflow" >&2
+echo "$output" | grep -Fqx '4: .p=40, .V=40' || wail
 
 # Exercise boundary values.
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]