@@ -665,6 +665,185 @@ Begin VB.Form Form1
665
665
AssertTree ( parseResult . Item1 , parseResult . Item2 , "//moduleConfig" , matches => matches . Count == 1 ) ;
666
666
}
667
667
668
+ [ Category ( "Parser" ) ]
669
+ [ Test ]
670
+ public void TestVBFormWithHexLiteralModuleConfig ( )
671
+ {
672
+ string code = @"
673
+ Begin VB.Form Form1
674
+ BackColor = &H00FFFFFF&
675
+ Caption = ""Form1""
676
+ ClientHeight = 2640
677
+ ClientLeft = 45
678
+ ClientTop = 375
679
+ ClientWidth = 4710
680
+ OleObjectBlob = ""Form1.frx"":0000
681
+ StartUpPosition = 1 'CenterOwner
682
+ End
683
+ " ;
684
+ var parseResult = Parse ( code ) ;
685
+ AssertTree ( parseResult . Item1 , parseResult . Item2 , "//moduleConfig" , matches => matches . Count == 1 ) ;
686
+ }
687
+
688
+ [ Category ( "Parser" ) ]
689
+ [ Test ]
690
+ public void TestVBFormWithAbsoluteResourcePathConfig ( )
691
+ {
692
+ string code = @"
693
+ Begin VB.Form Form1
694
+ BackColor = &H00FFFFFF&
695
+ Caption = ""Form1""
696
+ ClientHeight = 2640
697
+ ClientLeft = 45
698
+ ClientTop = 375
699
+ ClientWidth = 4710
700
+ OleObjectBlob = ""C:\Test\Form1.frx"":0000
701
+ StartUpPosition = 1 'CenterOwner
702
+ End
703
+ " ;
704
+ var parseResult = Parse ( code ) ;
705
+ AssertTree ( parseResult . Item1 , parseResult . Item2 , "//moduleConfig" , matches => matches . Count == 1 ) ;
706
+ }
707
+
708
+ [ Category ( "Parser" ) ]
709
+ [ Test ]
710
+ public void TestVBFormWithDnsUncResourcePathConfig ( )
711
+ {
712
+ string code = @"
713
+ Begin VB.Form Form1
714
+ BackColor = &H00FFFFFF&
715
+ Caption = ""Form1""
716
+ ClientHeight = 2640
717
+ ClientLeft = 45
718
+ ClientTop = 375
719
+ ClientWidth = 4710
720
+ OleObjectBlob = ""\\initech.com\server01\c$\Test\Form1.frx"":0000
721
+ StartUpPosition = 1 'CenterOwner
722
+ End
723
+ " ;
724
+ var parseResult = Parse ( code ) ;
725
+ AssertTree ( parseResult . Item1 , parseResult . Item2 , "//moduleConfig" , matches => matches . Count == 1 ) ;
726
+ }
727
+
728
+ [ Category ( "Parser" ) ]
729
+ [ Test ]
730
+ public void TestVBFormWithIPUncResourcePathConfig ( )
731
+ {
732
+ string code = @"
733
+ Begin VB.Form Form1
734
+ BackColor = &H00FFFFFF&
735
+ Caption = ""Form1""
736
+ ClientHeight = 2640
737
+ ClientLeft = 45
738
+ ClientTop = 375
739
+ ClientWidth = 4710
740
+ OleObjectBlob = ""\\127.0.0.1\Test\Form1.frx"":0000
741
+ StartUpPosition = 1 'CenterOwner
742
+ End
743
+ " ;
744
+ var parseResult = Parse ( code ) ;
745
+ AssertTree ( parseResult . Item1 , parseResult . Item2 , "//moduleConfig" , matches => matches . Count == 1 ) ;
746
+ }
747
+
748
+ [ Category ( "Parser" ) ]
749
+ [ Test ]
750
+ public void TestVBFormWithDollarPrependedResourceModuleConfig ( )
751
+ {
752
+ string code = @"
753
+ Begin VB.Form Form1
754
+ Caption = ""Form1""
755
+ ClientHeight = 2640
756
+ ClientLeft = 45
757
+ ClientTop = 375
758
+ ClientWidth = 4710
759
+ OleObjectBlob = $""Form1.frx"":0000
760
+ StartUpPosition = 1 'CenterOwner
761
+ End
762
+ " ;
763
+ var parseResult = Parse ( code ) ;
764
+ AssertTree ( parseResult . Item1 , parseResult . Item2 , "//moduleConfig" , matches => matches . Count == 1 ) ;
765
+ }
766
+
767
+ [ Category ( "Parser" ) ]
768
+ [ Test ]
769
+ public void TestVBFormWithAlphaLeadingHexLiteralResourceOffsetModuleConfig ( )
770
+ {
771
+ string code = @"
772
+ Begin VB.Form Form1
773
+ Caption = ""Form1""
774
+ ClientHeight = 2640
775
+ ClientLeft = 45
776
+ ClientTop = 375
777
+ ClientWidth = 4710
778
+ OleObjectBlob = ""Form1.frx"":ACBD
779
+ StartUpPosition = 1 'CenterOwner
780
+ End
781
+ " ;
782
+ var parseResult = Parse ( code ) ;
783
+ AssertTree ( parseResult . Item1 , parseResult . Item2 , "//moduleConfig" , matches => matches . Count == 1 ) ;
784
+ }
785
+
786
+ [ Category ( "Parser" ) ]
787
+ [ Test ]
788
+ public void TestVBFormWithNumericLeadingHexLiteralResourceOffsetModuleConfig ( )
789
+ {
790
+ string code = @"
791
+ Begin VB.Form Form1
792
+ Caption = ""Form1""
793
+ ClientHeight = 2640
794
+ ClientLeft = 45
795
+ ClientTop = 375
796
+ ClientWidth = 4710
797
+ OleObjectBlob = ""Form1.frx"":9ABC
798
+ StartUpPosition = 1 'CenterOwner
799
+ End
800
+ " ;
801
+ var parseResult = Parse ( code ) ;
802
+ AssertTree ( parseResult . Item1 , parseResult . Item2 , "//moduleConfig" , matches => matches . Count == 1 ) ;
803
+ }
804
+
805
+ [ Category ( "Parser" ) ]
806
+ [ Test ]
807
+ [ TestCase ( @"^A" ) ]
808
+ [ TestCase ( @"^Z" ) ]
809
+ [ TestCase ( @"{F1}" ) ]
810
+ [ TestCase ( @"{F12}" ) ]
811
+ [ TestCase ( @"^{F1}" ) ]
812
+ [ TestCase ( @"^{F12}" ) ]
813
+ [ TestCase ( @"+{F1}" ) ]
814
+ [ TestCase ( @"+{F12}" ) ]
815
+ [ TestCase ( @"+^{F1}" ) ]
816
+ [ TestCase ( @"+^{F12}" ) ]
817
+ [ TestCase ( @"^{INSERT}" ) ]
818
+ [ TestCase ( @"+{INSERT}" ) ]
819
+ [ TestCase ( @"{DEL}" ) ]
820
+ [ TestCase ( @"+{DEL}" ) ]
821
+ [ TestCase ( @"%{BKSP}" ) ]
822
+ public void TestVBFormWithMenuShortcutModuleConfig ( string shortcut )
823
+ {
824
+ string code = @"
825
+ Begin VB.Form Form1
826
+ Caption = ""Form1""
827
+ ClientHeight = 2640
828
+ ClientLeft = 45
829
+ ClientTop = 375
830
+ ClientWidth = 4710
831
+ OleObjectBlob = ""Form1.frx"":0000
832
+ StartUpPosition = 1 'CenterOwner
833
+ Begin VB.Menu FileMenu
834
+ Caption = ""File""
835
+ Begin VB.Menu FileOpenMenu
836
+ Caption = ""Open""
837
+ Shortcut = " + shortcut + @"
838
+ End
839
+ End
840
+ End
841
+ " ;
842
+ var parseResult = Parse ( code ) ;
843
+ AssertTree ( parseResult . Item1 , parseResult . Item2 , "//moduleConfig" , matches => matches . Count == 3 ) ;
844
+ }
845
+
846
+
668
847
[ Category ( "Parser" ) ]
669
848
[ Test ]
670
849
public void TestNestedVbFormModuleConfig ( )
0 commit comments