File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,28 @@ RBPatternParserTest >> testParseFaultyPatternBlock [
4848 self assert: node isFaulty]
4949]
5050
51+ { #category : #' tests - parsing' }
52+ RBPatternParserTest >> testPatternNotStringExpression [
53+ | searchPattern tree |
54+ searchPattern := RBPatternParser parseExpression: ' `{ :node | node isString }' .
55+
56+ tree := self parseExpression: ' a = a1' .
57+
58+ self deny: (searchPattern match: tree inContext: Dictionary new ).
59+
60+ ]
61+
62+ { #category : #' tests - parsing' }
63+ RBPatternParserTest >> testPatternStringExpression [
64+ | searchPattern tree |
65+ searchPattern := RBPatternParser parseExpression: ' `{ :node | node isString }' .
66+
67+ tree := self parseExpression: ' ' ' justAString' ' ' .
68+
69+ self assert: (searchPattern match: tree inContext: Dictionary new ).
70+
71+ ]
72+
5173{ #category : #' tests - parsing' }
5274RBPatternParserTest >> testPatternVariable [
5375 | searchPattern |
Original file line number Diff line number Diff line change @@ -67,6 +67,12 @@ RBLiteralValueNode >> evaluateForReceiver: aReceicer [
6767 ^ value
6868]
6969
70+ { #category : #testing }
71+ RBLiteralValueNode >> isString [
72+
73+ ^ value isString and : [ value isSymbol not ]
74+ ]
75+
7076{ #category : #accessing }
7177RBLiteralValueNode >> sourceText [
7278
You can’t perform that action at this time.
0 commit comments