help-smalltalk
[Top][All Lists]
Advanced

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

Re: [Help-smalltalk] sunit log error?


From: Holger Hans Peter Freyther
Subject: Re: [Help-smalltalk] sunit log error?
Date: Sat, 12 Oct 2013 21:17:43 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Sat, Oct 12, 2013 at 09:00:27PM +0200, Holger Hans Peter Freyther wrote:
> On Sat, Oct 12, 2013 at 06:30:19PM +0200, Paolo Bonzini wrote:
> > Can you guys look at what caused the double sharp? :)
> 
> probably 0f550663b46a9785c353dbab8b2721f8b5620ce0 :)

not beautiful... but what about this?


diff --git a/packages/sunit/SUnit.st b/packages/sunit/SUnit.st
index 38a872b..871f541 100644
--- a/packages/sunit/SUnit.st
+++ b/packages/sunit/SUnit.st
@@ -1121,8 +1121,10 @@ When you are writing a test case method, send #assert: 
aBoolean when you want to
        <category: 'Printing'>
        aStream
            nextPutAll: self class printString;
-           nextPutAll: '>>#';
-           nextPutAll: testSelector printString.
+           nextPutAll: '>>';
+           nextPutAll: (testSelector isNil
+                           ifTrue: [#nil]
+                           ifFalse: [testSelector]) printString.
     ]
 ]
 
diff --git a/packages/sunit/SUnitTests.st b/packages/sunit/SUnitTests.st
index 166ee89..ed44412 100644
--- a/packages/sunit/SUnitTests.st
+++ b/packages/sunit/SUnitTests.st
@@ -278,11 +278,19 @@ if the tests are hard to write, something is probably 
wrong with the design".'>
 
     testPrintString [
         <category: 'Testing'>
-        "Make sure that a new test can be printed"
+       | suite result |
+        "Make sure that a new test can be printed and that for
+        a ran test it shows only one hash."
 
         self
             shouldnt: [TestCase new printString] raise: Exception;
             assert: TestCase new printString = 'TestCase>>#nil'.
+
+       suite := TestSuite new.
+       suite addTest: (SUnitClientTest selector: #noop).
+       result := suite run.
+
+       self assert: suite tests first printString = 'SUnitClientTest>>#noop'.
     ]
 
     isLogging [



reply via email to

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