[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Fixing plural case in Banner
From: |
William Pursell |
Subject: |
Fixing plural case in Banner |
Date: |
Thu, 09 Oct 2008 17:31:46 +0100 |
User-agent: |
Thunderbird 2.0.0.17 (Macintosh/20080914) |
Here's a patch to prevent that grammatically
incorrect text: "All 1 tests passed"
Unfortunately, I haven't been able to build
automake, so I cut-and-pasted from here into
a Makefile to check the syntax. It's a pretty
simple patch, and hopefully I haven't flubbed
it.
--
William Pursell
>From 2e34a76d05198329726c43ffc1f31aa926768a49 Mon Sep 17 00:00:00 2001
From: William Pursell <address@hidden>
Date: Thu, 9 Oct 2008 17:02:00 +0100
Subject: [PATCH] Fix grammar w.r.t. plurals in test reports.
---
lib/am/check.am | 21 ++++++++++++++++-----
1 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/lib/am/check.am b/lib/am/check.am
index daae5a2..f8c1436 100644
--- a/lib/am/check.am
+++ b/lib/am/check.am
@@ -86,24 +86,35 @@ check-TESTS: $(TESTS)
echo "$${col}$$res$${std}: $$tst"; \
done; \
## Prepare the banner
+ if test "$$all" -eq 1; then \
+ tests="test"; \
+ All=""; \
+ else \
+ tests="tests"; \
+ All="All"; \
+ fi; \
if test "$$failed" -eq 0; then \
if test "$$xfail" -eq 0; then \
- banner="All $$all tests passed"; \
+ banner="$$All $$all $$tests passed"; \
else \
- banner="All $$all tests behaved as expected ($$xfail expected
failures)"; \
+ banner="$$All $$all $$tests behaved as expected ($$xfail expected
failures)"; \
fi; \
else \
if test "$$xpass" -eq 0; then \
- banner="$$failed of $$all tests failed"; \
+ banner="$$failed of $$all $$tests failed"; \
else \
- banner="$$failed of $$all tests did not behave as expected
($$xpass unexpected passes)"; \
+ banner="$$failed of $$all $$tests did not behave as expected
($$xpass unexpected passes)"; \
fi; \
fi; \
## DASHES should contain the largest line of the banner.
dashes="$$banner"; \
skipped=""; \
if test "$$skip" -ne 0; then \
- skipped="($$skip tests were not run)"; \
+ if test "$$skip" -eq 1; then \
+ skipped="($$skip test was not run)"; \
+ else \
+ skipped="($$skip tests were not run)"; \
+ fi; \
test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
dashes="$$skipped"; \
fi; \
--
1.6.0.2.GIT
- Fixing plural case in Banner,
William Pursell <=