File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -178,6 +178,21 @@ public void Structs55_Test()
178178 Assert . True ( StructsTestClass_55 . testMethod ( ) ) ;
179179 }
180180
181+ [ TestMethod ]
182+ public void ValueTest_StructEquals_01 ( )
183+ {
184+ AStruct s1 = new AStruct ( ) { a = 1 } ;
185+ AStruct s2 = new AStruct ( ) { a = 2 } ;
186+
187+ Assert . True ( s1 . Equals ( s1 ) , "Comparing struct failed: s1.Equals(s1)" ) ;
188+ Assert . False ( s1 . Equals ( s2 ) , "Comparing struct failed: s1.Equals(s2)" ) ;
189+ Assert . True ( s1 . a . Equals ( s1 . a ) , "Comparing struct failed: s1.a.Equals(s1.a)" ) ;
190+ Assert . False ( s1 . a . Equals ( s2 . a ) , "Comparing struct failed: s1.a.Equals(s2.a)" ) ;
191+ // TODO
192+ // these are failing: need to fix the comparer at CLR
193+ //Assert.False(s1.Equals(null), "Comparing struct failed: s1.Equals(null)");
194+ //Assert.False(s1.Equals(null), "Comparing struct failed: s1.Equals(null)");
195+ }
181196
182197 //Compiled Test Cases
183198 class StructsTestClass_01_Notes
@@ -1031,6 +1046,9 @@ public static bool testMethod()
10311046 }
10321047 }
10331048
1034-
1049+ public struct AStruct
1050+ {
1051+ public int a { get ; set ; }
1052+ }
10351053 }
10361054}
Original file line number Diff line number Diff line change 66 "type" : " Direct" ,
77 "requested" : " [1.12.0, 1.12.0]" ,
88 "resolved" : " 1.12.0" ,
9- "contentHash" : " ls2oi2tgc511yCRrbBOD3KjS9AL4mIWwEs6/g3DuLhGpALhla/g1Dr9qry69M3NwEWEY3rSolxIiwueeqepckQ =="
9+ "contentHash" : " qQrFNXmJiStMC4VXk5cVMOJp23/qlT9FW5i9i+igwQVwraQTtvpkam8yK1hj992jqrbjoCIFZP4Hw9E8H0pB7w =="
1010 },
1111 "nanoFramework.TestFramework" : {
1212 "type" : " Direct" ,
You can’t perform that action at this time.
0 commit comments