Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Commit

Permalink
Label implements IEquatable<Label> (#35673)
Browse files Browse the repository at this point in the history
* Label implements IEquatable<Label>

* Add Unit Tests for IEquatable<Label>

* Actually track LabelEquals.cs this time

* Move Label IEquatable declaration to ILGeneration.netcore

* Merge IEquatable unit tests with existing equality tests
  • Loading branch information
Foxtrek64 authored and stephentoub committed Apr 6, 2019
1 parent b7fddf8 commit b561cd4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ public partial class ILGenerator
{
public virtual void EmitCalli(System.Reflection.Emit.OpCode opcode, System.Runtime.InteropServices.CallingConvention unmanagedCallConv, Type returnType, Type[] parameterTypes) { }
}

public partial struct Label : IEquatable<System.Reflection.Emit.Label>
{ }
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public void Equals_SameInstance_ReturnsTrue()
Label label = new Label();
Assert.True(label.Equals(label));
Assert.True(label.Equals((object)label));
Assert.True(label.Equals((IEquatable<Label>)label));
}

[Fact]
Expand All @@ -27,6 +28,7 @@ public void Equals_DifferentLabel_ReturnsFalse()

Assert.False(label1.Equals(label2));
Assert.False(label1.Equals((object)label2));
Assert.False(label1.Equals((IEquatable<Label>)label2));
}

[Theory]
Expand Down

0 comments on commit b561cd4

Please sign in to comment.