File tree 1 file changed +18
-9
lines changed
1 file changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -89,18 +89,27 @@ describe('Test strings', function() {
89
89
it ( '...' , function ( ) {
90
90
var ast = parser . parseEval ( 'return "Class.create(\'$package$className\',{";' ) ;
91
91
} ) ;
92
- it ( 'heredoc ... ' , function ( ) {
92
+ it ( 'test encapsed elements ' , function ( ) {
93
93
var ast = parser . parseEval ( [
94
94
'$code = <<<\t EOFX' ,
95
- '' ,
96
- '/*{$this->docStar}' ,
97
- ' * Constructor.' ,
98
- ' */' ,
99
- 'public function __construct()' ,
100
- '${$targetDirs}' ,
101
- '$test' ,
95
+ '{$this->docStar}' ,
96
+ '${$foo}' ,
97
+ '${targetDirs[1]}' ,
98
+ '$test[1]' ,
99
+ '$test->foo' ,
102
100
'EOFX;'
103
- ] . join ( '\r\n' ) ) ;
101
+ ] . join ( '\r' ) , {
102
+ parser : {
103
+ debug : false
104
+ }
105
+ } ) ;
106
+ var expr = ast . children [ 0 ] . right . value ;
107
+ expr [ 0 ] . kind . should . be . exactly ( 'propertylookup' ) ;
108
+ expr [ 2 ] . kind . should . be . exactly ( 'variable' ) ;
109
+ expr [ 4 ] . kind . should . be . exactly ( 'variable' ) ;
110
+ expr [ 6 ] . kind . should . be . exactly ( 'offsetlookup' ) ;
111
+ expr [ 8 ] . kind . should . be . exactly ( 'propertylookup' ) ;
112
+ // @todo : improve assertions
104
113
} ) ;
105
114
it ( 'test nowdoc label and contents' , function ( ) {
106
115
var ast = parser . parseEval ( [
You can’t perform that action at this time.
0 commit comments