@@ -604,13 +604,79 @@ echo result
604604" ;
605605 var expectedOutput = @"male" ;
606606
607- TestHelper . AssertTemplateOutput ( expectedOutput , template , mergeValues ) ;
607+ TestHelper . ExecuteForActiveEngines ( ( engine ) =>
608+ {
609+ TestHelper . AssertTemplateOutput ( engine , expectedOutput , template , mergeValues , ignoreWhitespace : true ) ;
610+ } ) ;
611+
608612 }
609613
614+ /// <summary>
615+ /// Verify that Rock's custom "//-" comments works inside an IF tag that is inside a {% lava %} {% liquid %} tag.
616+ /// </summary>
617+ [ TestMethod ]
618+ public void LavaTag_WithInnerIfTagAndLineComments_IsProcessedCorrectly ( )
619+ {
620+ var template = @"
621+ {% liquid
622+
623+ //- Comment level one
624+ assign isTest = true
625+ if isTest
626+
627+ //- Comment level two
628+ assign isTest = false
629+
630+ endif
631+ echo isTest
632+
633+ %}
634+ " ;
635+ var expectedOutput = @"false" ;
636+
637+ TestHelper . ExecuteForActiveEngines ( ( engine ) =>
638+ {
639+ TestHelper . AssertTemplateOutput ( engine , expectedOutput , template , ignoreWhitespace : true ) ;
640+ } ) ;
641+ }
642+
643+
644+ /// <summary>
645+ /// Verify that Rock's custom "/- -/" block comments works inside an IF tag that is inside a {% lava %} {% liquid %} tag.
646+ /// </summary>
647+ [ TestMethod ]
648+ public void LavaTag_WithCommentesNestedInIfTag_IsProcessedCorrectly ( )
649+ {
650+ var template = @"
651+ {% lava
652+ //- Comment level one
653+ assign isTest = true
654+ if isTest
655+
656+ /-
657+ assign isTest = false
658+ -/
659+
660+ endif
661+ echo isTest
662+ %}
663+ " ;
664+ var expectedOutput = @"true" ;
665+
666+ TestHelper . ExecuteForActiveEngines ( ( engine ) =>
667+ {
668+ TestHelper . AssertTemplateOutput ( engine , expectedOutput , template , ignoreWhitespace : true ) ;
669+ } ) ;
670+
671+ }
672+
673+ /// <summary>
674+ /// Verify that Rock's custom "/- -/" block comments works inside an IF tag that is inside a {% lava %} {% liquid %} tag.
675+ /// </summary>
610676 [ TestMethod ]
611677 public void LavaTag_WithInnerIfTagAndBlockComment_SpanningMultipleLines_IsProcessedCorrectly ( )
612678 {
613- var input = @"
679+ var template = @"
614680{% liquid
615681 assign isTest = true
616682 /- This is a block comment...
@@ -623,10 +689,94 @@ ... spanning multiple lines. -/
623689 echo isTest
624690%}
625691" ;
626-
627692 var expectedOutput = @"false" ;
628693
629- TestHelper . AssertTemplateOutput ( expectedOutput , input ) ;
694+ TestHelper . ExecuteForActiveEngines ( ( engine ) =>
695+ {
696+ TestHelper . AssertTemplateOutput ( engine , expectedOutput , template , ignoreWhitespace : true ) ;
697+ } ) ;
698+ }
699+
700+ /// <summary>
701+ /// Verify that Rock's custom "//-" block comments works inside a FOR tag that is inside a {% lava %} {% liquid %} tag.
702+ /// </summary>
703+ [ TestMethod ]
704+ public void LavaTag_WithSingleLineCommentInsideForTag_IsProcessedCorrectly ( )
705+ {
706+ var template = @"
707+ {% lava
708+ //- Comment level one
709+ assign test = -1
710+ assign loopCount = 5
711+ for i in (0..loopCount)
712+
713+ //- Comment level two
714+ assign test = i
715+
716+ endfor
717+ echo test
718+ %}
719+ " ;
720+ var expectedOutput = @"5" ;
721+
722+ TestHelper . ExecuteForActiveEngines ( ( engine ) =>
723+ {
724+ TestHelper . AssertTemplateOutput ( engine , expectedOutput , template , ignoreWhitespace : true ) ;
725+ } ) ;
726+ }
727+
728+ /// <summary>
729+ /// Verify that Rock's custom "//-" block comments works inside a FOR tag that is inside a {% lava %} {% liquid %} tag.
730+ /// </summary>
731+ [ TestMethod ]
732+ public void LavaTag_WithCommentBlockInsideForTag_IsProcessedCorrectly ( )
733+ {
734+ var template = @"
735+ {% lava
736+ //- Comment level one
737+ assign test = -1
738+ assign loopCount = 5
739+ for i in (0..loopCount)
740+
741+ /-
742+ assign test = i
743+ -/
744+
745+ endfor
746+ echo test
747+ %}
748+ " ;
749+ var expectedOutput = @"-1" ;
750+
751+ TestHelper . ExecuteForActiveEngines ( ( engine ) =>
752+ {
753+ TestHelper . AssertTemplateOutput ( engine , expectedOutput , template , ignoreWhitespace : true ) ;
754+ } ) ;
755+ }
756+
757+ /// <summary>
758+ /// Verify that Liquid's "#" comments works inside a {% lava %} {% liquid %} tag.
759+ /// NOTE: This is not supported in Rock (or Fluid as far as I can tell).
760+ /// </summary>
761+ [ TestMethod ]
762+ [ Ignore ] // Ignored because this is not currently supported in Fluid.
763+ public void LavaTag_WithSingleLineHashComment_IsProcessedCorrectly ( )
764+ {
765+ var template = @"
766+ {% liquid
767+
768+ # This is a comment
769+ assign test = 5
770+
771+ echo test
772+ %}
773+ " ;
774+ var expectedOutput = @"5" ;
775+
776+ TestHelper . ExecuteForActiveEngines ( ( engine ) =>
777+ {
778+ TestHelper . AssertTemplateOutput ( engine , expectedOutput , template , ignoreWhitespace : true ) ;
779+ } ) ;
630780 }
631781 #endregion
632782
0 commit comments