 	}
 	fatalError("groupBy reached a non-empty list that could not produce a first element")
 }
+
+private func pluralize(s : String, i : Int) -> String {
+	if i == 1 {
+		return s
+	}
+	return s + "s"
+}

	}
}

internal func doneTesting(st : State)(f : (StdGen -> Int -> Prop)) -> Result {
	if st.expectedFailure {
		println("*** Passed " + "\(st.numSuccessTests)" + " tests")
		printDistributionGraph(st)
		return .Success(numTests: st.numSuccessTests, labels: summary(st), output: "")
	} else {

	let testMsg = " (after \(st.numSuccessTests + 1) test"
	let shrinkMsg = st.numSuccessShrinks > 1 ? (" and \(st.numSuccessShrinks) shrink") : ""
	
	println("Proposition: " + st.name)
	println(res.reason + pluralize(testMsg, st.numSuccessTests + 1) + pluralize(shrinkMsg, st.numSuccessShrinks) + "):")
	dispatchAfterFinalFailureCallbacks(st, res)
