'From Squeak3.7alpha of 11 September 2003 [latest update: #5816] on 14 March 2004 at 5:39:28 pm'! "Change Set: asCommTest Date: 28 October 2003 Author: Lex Spoon md: V2 moved to StringTest. A test case for #asSmalltalkComment, a method in the browseWithComments enhancment."! !StringTest methodsFor: 'testing - converting' stamp: 'md 3/14/2004 17:37'! testAsSmalltalkComment | exampleStrings | exampleStrings := #( '' ' ' '"' '""' '"""' 'abc"abc' 'abc""abc' 'abc"hello"abc' 'abc"' '"abc' ). "check that the result of scanning the comment is empty" exampleStrings do: [ :s | | tokens | tokens := Scanner new scanTokens: s asSmalltalkComment. self should: [ tokens isEmpty ] ]. "check that the result has the same non-quote characters as the original" exampleStrings do: [ :s | self should: [ (s copyWithout: $") = (s asSmalltalkComment copyWithout: $") ] ]. "finnaly, test for some common kinds of inputs" self should: [ 'abc' asSmalltalkComment = '"abc"'. ]. self should: [ 'abc"abc' asSmalltalkComment = '"abc""abc"'. ]. self should: ['abc""abc' asSmalltalkComment = '"abc""abc"' ]. ! ! StringTest removeSelector: #tearDown! !StringTest reorganize! ('initialize-release' setUp) ('testing - converting' testAsSmalltalkComment) ('testing - accessing' testAt) !