@@ -15,7 +15,7 @@ Class {
1515{ #category : ' running' }
1616FASTPythonImporterTest >> parse: aString [
1717
18- fast := importer parse: ' #There is only one comment ' withPlatformLineEndings
18+ fast := importer parse: aString withPlatformLineEndings
1919]
2020
2121{ #category : ' running' }
@@ -29,8 +29,32 @@ FASTPythonImporterTest >> setUp [
2929{ #category : ' tests' }
3030FASTPythonImporterTest >> testFileWithOneComment [
3131
32+ | entity |
3233 self parse: ' #There is only one comment' .
3334
3435 self assert: (fast allWithType: FASTPythonModule ) size equals: 1 .
35- self assert: (fast allWithType: FASTPythonComment ) size equals: 1
36+ entity := (fast allWithType: FASTPythonModule ) anyOne.
37+ self assert: entity sourceCode equals: ' #There is only one comment' .
38+
39+ self assert: (fast allWithType: FASTPythonComment ) size equals: 1 .
40+ entity := (fast allWithType: FASTPythonComment ) anyOne.
41+ self assert: entity sourceCode equals: ' #There is only one comment'
42+ ]
43+
44+ { #category : ' tests' }
45+ FASTPythonImporterTest >> testFileWithTwoComments [
46+
47+ | entity |
48+ self parse: ' # Comment 1
49+
50+ # Comment 2' .
51+
52+ self assert: (fast allWithType: FASTPythonModule ) size equals: 1 .
53+ entity := (fast allWithType: FASTPythonModule ) anyOne.
54+ self assert: entity sourceCode equals: ' # Comment 1
55+
56+ # Comment 2' withPlatformLineEndings.
57+
58+ self assert: (fast allWithType: FASTPythonComment ) size equals: 2 .
59+ self assertCollection: ((fast allWithType: FASTPythonComment ) collect: #sourceCode as: Array ) hasSameElements: { ' # Comment 1' . ' # Comment 2' }
3660]
0 commit comments