@@ -102,6 +102,51 @@ void testParserOptionsTrackWhitespace() {
102102 assertFalse (inspectWithout .contains ("WhitespaceNode" ));
103103 }
104104
105+ @ Test
106+ void testParserOptionsPrismNodes () {
107+ String source = "<%= user.name %>" ;
108+
109+ ParseResult withPrism = Herb .parse (source , ParserOptions .create ().prismNodes (true ));
110+ String inspected = withPrism .inspect ();
111+
112+ assertTrue (inspected .contains ("prism_node:" ));
113+ }
114+
115+ @ Test
116+ void testParserOptionsPrismNodesString () {
117+ String source = "<%= \" String\" %>" ;
118+
119+ ParseResult withPrism = Herb .parse (source , ParserOptions .create ().prismNodes (true ));
120+ String inspected = withPrism .inspect ();
121+
122+ assertTrue (inspected .contains ("prism_node:" ));
123+ assertTrue (inspected .contains ("String" ));
124+ }
125+
126+ @ Test
127+ void testParserOptionsPrismProgram () {
128+ String source = "<%= \" hello\" %>" ;
129+
130+ ParseResult withPrism = Herb .parse (source , ParserOptions .create ().prismProgram (true ));
131+ String inspected = withPrism .inspect ();
132+
133+ assertTrue (inspected .contains ("prism_node:" ));
134+ }
135+
136+ @ Test
137+ void testParserOptionsPrismNodesDeep () {
138+ String source = "<% if true %><%= \" yes\" %><% end %>" ;
139+
140+ ParseResult withDeep = Herb .parse (source , ParserOptions .create ().prismNodes (true ).prismNodesDeep (true ));
141+ ParseResult withoutDeep = Herb .parse (source , ParserOptions .create ().prismNodes (true ).prismNodesDeep (false ));
142+
143+ String inspectDeep = withDeep .inspect ();
144+ String inspectShallow = withoutDeep .inspect ();
145+
146+ assertTrue (inspectDeep .contains ("prism_node:" ));
147+ assertTrue (inspectShallow .contains ("prism_node:" ));
148+ }
149+
105150 @ Test
106151 void testParserOptionsAnalyze () {
107152 String source = "<% if true %><div></div><% end %>" ;
0 commit comments