Skip to content

Commit

Permalink
+ testCanParseAttributesWithSeveralSpaces
Browse files Browse the repository at this point in the history
~organize code
  • Loading branch information
badetitou committed Aug 18, 2023
1 parent 5c2a149 commit caf064b
Show file tree
Hide file tree
Showing 3 changed files with 717 additions and 651 deletions.
41 changes: 34 additions & 7 deletions src/Famix-Html-Importer-Tests/FamixHtmlImporterTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ FamixHtmlImporterTest >> setUp [
importer model: htmlModel
]

{ #category : #initialization }
{ #category : #'parse - attributes' }
FamixHtmlImporterTest >> testCanImportComplexAttributeValue [

importer importString: '<div att="hello<--world"></div>'.
Expand Down Expand Up @@ -58,7 +58,7 @@ FamixHtmlImporterTest >> testCanImportSimpleDiv [
equals: 'div'
]

{ #category : #initialization }
{ #category : #'parse - attributes' }
FamixHtmlImporterTest >> testCanImportSimpleDivWithAttribute [

importer importString: '<div att="hello"></div>'.
Expand Down Expand Up @@ -99,7 +99,7 @@ FamixHtmlImporterTest >> testCanImportTagWithEndOfLine [
equals: '"hello"'
]

{ #category : #initialization }
{ #category : #'parse - attributes' }
FamixHtmlImporterTest >> testCanParseAttributePrefixedWithStar [

importer importString: '<div *ngIf="hello"></div>'.
Expand All @@ -113,21 +113,48 @@ FamixHtmlImporterTest >> testCanParseAttributePrefixedWithStar [
equals: '*ngIf'
]

{ #category : #initialization }
{ #category : #'parse - attributes' }
FamixHtmlImporterTest >> testCanParseAttributeWithComa [

importer importString: '<div att="''hello1''"></div>'.
self assert: (htmlModel allWithType: FamixHtmlElement) size equals: 1
]

{ #category : #'parse - attributes' }
FamixHtmlImporterTest >> testCanParseAttributesWithSeveralSpaces [

importer importString:
'<div class = "hello" secondAttribute lastAttribute = "''tired''"></div>'.
self
assert: (htmlModel allWithType: FamixHtmlAttribute) size
equals: 3.
self
assert:
((htmlModel allWithType: FamixHtmlAttribute) detect: [ :att |
att attributeName = 'class' ]) attributeValue
equals: '"hello"'.

self
assert:
((htmlModel allWithType: FamixHtmlAttribute) detect: [ :att |
att attributeName = 'secondAttribute' ]) attributeValue
equals: nil.

self
assert:
((htmlModel allWithType: FamixHtmlAttribute) detect: [ :att |
att attributeName = 'lastAttribute' ]) attributeValue
equals: '"''tired''"'
]

{ #category : #initialization }
FamixHtmlImporterTest >> testCanParseCommentFirstThenDiv [

importer importString: '<!-- hello --> <div></div>'.
self assert: (htmlModel allWithType: FamixHtmlElement) size equals: 1
]

{ #category : #initialization }
{ #category : #'parse - attributes' }
FamixHtmlImporterTest >> testCanParseConsecutiveAttributes [

importer importString:
Expand Down Expand Up @@ -315,7 +342,7 @@ FamixHtmlImporterTest >> testParseWithInterpolation [
self assert: (htmlModel allWithType: FamixHtmlElement) size equals: 3
]

{ #category : #initialization }
{ #category : #'parse - attributes' }
FamixHtmlImporterTest >> testShortTagWithShortAttribute [

importer importString: '<div test/>'.
Expand All @@ -325,7 +352,7 @@ FamixHtmlImporterTest >> testShortTagWithShortAttribute [
equals: 1
]

{ #category : #initialization }
{ #category : #'parse - attributes' }
FamixHtmlImporterTest >> testShortTagWithShortHashAttribute [

importer importString: '<div #test/>'.
Expand Down
Loading

0 comments on commit caf064b

Please sign in to comment.