E
Ethan Strauss
This is mostly just curiousity. I was writting a unit test to verify that I
was creating a Regex correctly. This involved
Assert.AreEqual(expected, actual)
where expected and actual are both Regex objects. My code failed the test
:-(, but I think it because I had created two Regex objects which would find
the same Matches, but did not have identical patterns (the same set of
characters, but in different orders with []). I am not surprised that the two
different Regex objects are not evaluated for equivalence, but it brings up
the question of how Assert determines equality for Reference types? Does
anyone know?
Thanks,
Ethan
was creating a Regex correctly. This involved
Assert.AreEqual(expected, actual)
where expected and actual are both Regex objects. My code failed the test
:-(, but I think it because I had created two Regex objects which would find
the same Matches, but did not have identical patterns (the same set of
characters, but in different orders with []). I am not surprised that the two
different Regex objects are not evaluated for equivalence, but it brings up
the question of how Assert determines equality for Reference types? Does
anyone know?
Thanks,
Ethan