File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -938,15 +938,10 @@ public void ExpressionDepthLimitStopsDeepNestedExpressionsBeforeStackOverflow(st
938938 var template = Template . Parse ( $ "{{{{ { expression } }}}}") ;
939939
940940 Assert . True ( template . HasErrors ) ;
941- if ( expressionKind == "objects" )
942- {
943- StringAssert . Contains ( "The parser recursive depth limit was reached near a stack overflow" , template . Messages [ 0 ] . ToString ( ) ) ;
944- }
945- else
946- {
947- StringAssert . Contains ( "The statement depth limit `250` was reached when parsing this statement" , template . Messages [ 0 ] . ToString ( ) ) ;
948-
949- }
941+ // Available stack space varies by platform and test runner, so either safety guard may stop parsing first.
942+ Assert . That ( template . Messages [ 0 ] . ToString ( ) ,
943+ Does . Contain ( "The statement depth limit `250` was reached when parsing this statement" )
944+ . Or . Contain ( "The parser recursive depth limit was reached near a stack overflow" ) ) ;
950945 }
951946
952947 [ Test ]
You can’t perform that action at this time.
0 commit comments