From 186707162fcc23a82c2213cdf70b7474a713931d Mon Sep 17 00:00:00 2001
From: Holger Hans Peter Freyther
Date: Thu, 15 Apr 2010 14:02:30 +0200
Subject: [PATCH 3/4] SUnit: Use the new selectors for (un)expected failure/success
Use the new selectors to handle unexpected success and
expected success on test cases. The change is coming from
the Pharo image.
Right now the plural handling for errors/failures is lost.
---
packages/sunit/SUnit.st | 23 +++++++++++++----------
1 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/packages/sunit/SUnit.st b/packages/sunit/SUnit.st
index f187c8d..49bd9d6 100644
--- a/packages/sunit/SUnit.st
+++ b/packages/sunit/SUnit.st
@@ -300,7 +300,7 @@ This is a Collecting Parameter for the running of a bunch of tests. TestResult i
errors [
- ^errors
+ ^self unexpectedErrors
]
expectedDefectCount [
@@ -366,7 +366,7 @@ This is a Collecting Parameter for the running of a bunch of tests. TestResult i
passed [
- ^passed
+ ^self expectedPasses, self expectedDefects
]
passedCount [
@@ -376,7 +376,7 @@ This is a Collecting Parameter for the running of a bunch of tests. TestResult i
runCount [
- ^self passedCount + self failureCount + self errorCount
+ ^passed size + failures size + errors size
]
tests [
@@ -452,13 +452,16 @@ This is a Collecting Parameter for the running of a bunch of tests. TestResult i
aStream
nextPutAll: self runCount printString;
nextPutAll: ' run, ';
- nextPutAll: self passedCount printString;
- nextPutAll: ' passed, ';
- nextPutAll: self failureCount printString;
- nextPutAll: ' failed, ';
- nextPutAll: self errorCount printString;
- nextPutAll: ' error'.
- self errorCount ~= 1 ifTrue: [aStream nextPut: $s]
+ nextPutAll: self expectedPassCount printString;
+ nextPutAll: ' passes, ';
+ nextPutAll: self expectedDefectCount printString;
+ nextPutAll: ' expected failures, ';
+ nextPutAll: self unexpectedFailureCount printString;
+ nextPutAll: ' failures, ';
+ nextPutAll: self unexpectedErrorCount printString;
+ nextPutAll: ' errors, ';
+ nextPutAll: self unexpectedPassCount printString;
+ nextPutAll: ' unexpected passes'
]
]
--
1.7.0