Hi,

I thought about using the dual, but wasn't sure how many languages
support it.

Best,
David.
-- 
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate
>From 1fd595576c5972d8604adf77d1959008daebacb0 Mon Sep 17 00:00:00 2001
From: David Fetter <da...@fetter.org>
Date: Mon, 14 Jun 2021 21:51:20 -0700
Subject: [PATCH v1] Singular number when appropriate

---
 src/test/regress/pg_regress.c | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git src/test/regress/pg_regress.c src/test/regress/pg_regress.c
index 05296f7ee1..d6f9e829e8 100644
--- src/test/regress/pg_regress.c
+++ src/test/regress/pg_regress.c
@@ -2641,25 +2641,31 @@ regression_main(int argc, char *argv[],
 	 */
 	if (fail_count == 0 && fail_ignore_count == 0)
 		snprintf(buf, sizeof(buf),
-				 _(" All %d tests passed. "),
-				 success_count);
+				 _(" %s %d test%s passed. "),
+				 success_count == 1 ? "The" : "All",
+				 success_count,
+				 success_count == 1 ? "" : "s");
 	else if (fail_count == 0)	/* fail_count=0, fail_ignore_count>0 */
 		snprintf(buf, sizeof(buf),
-				 _(" %d of %d tests passed, %d failed test(s) ignored. "),
+				 _(" %d of %d test%s passed, %d failed test%s ignored. "),
 				 success_count,
 				 success_count + fail_ignore_count,
-				 fail_ignore_count);
+				 success_count == 1 ? "" : "s",
+				 fail_ignore_count,
+				 fail_ignore_count == 1 ? "" : "s");
 	else if (fail_ignore_count == 0)	/* fail_count>0 && fail_ignore_count=0 */
 		snprintf(buf, sizeof(buf),
-				 _(" %d of %d tests failed. "),
+				 _(" %d of %d test%s failed. "),
 				 fail_count,
-				 success_count + fail_count);
+				 success_count + fail_count,
+				 fail_count == 1 ? "" : "s");
 	else
 		/* fail_count>0 && fail_ignore_count>0 */
 		snprintf(buf, sizeof(buf),
-				 _(" %d of %d tests failed, %d of these failures ignored. "),
+				 _(" %d of %d test%s failed, %d of these failures ignored. "),
 				 fail_count + fail_ignore_count,
 				 success_count + fail_count + fail_ignore_count,
+				 fail_count + fail_ignore_count == 1 ? "" : "s",
 				 fail_ignore_count);
 
 	putchar('\n');
-- 
2.31.1

Reply via email to