Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 0bfa870

Browse files
Removes some tests that are now bogus
Last week I changed the implementation of encoders such that they now don't guarantee that their Default property always returns the same instance of the default encoder. Access to the property’s backing field used to be synchronized using memory berries; I now removed these synchronizations. This change was made to simplify code and improve performance of the common scenario: retrieving the default encoder, at the cost of having to create (and collect) more than one instance of the encoder in rare cases (once in a blue moon). This change just remove tests that test behavior that we don’t guarantee anymore.
1 parent e8edcdd commit 0bfa870

File tree

3 files changed

+0
-33
lines changed

3 files changed

+0
-33
lines changed

src/System.Text.Encodings.Web/tests/HtmlEncoderTests.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,6 @@ public void Default_EquivalentToBasicLatin()
7171
}
7272
}
7373

74-
[Fact]
75-
public void Default_ReturnsSingletonInstance()
76-
{
77-
// Act
78-
HtmlEncoder encoder1 = HtmlEncoder.Default;
79-
HtmlEncoder encoder2 = HtmlEncoder.Default;
80-
81-
// Assert
82-
Assert.Same(encoder1, encoder2);
83-
}
84-
8574
[Theory]
8675
[InlineData("<", "&lt;")]
8776
[InlineData(">", "&gt;")]

src/System.Text.Encodings.Web/tests/JavaScriptStringEncoderTests.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,6 @@ public void Default_EquivalentToBasicLatin()
7171
}
7272
}
7373

74-
[Fact]
75-
public void Default_ReturnsSingletonInstance()
76-
{
77-
// Act
78-
JavaScriptStringEncoder encoder1 = JavaScriptStringEncoder.Default;
79-
JavaScriptStringEncoder encoder2 = JavaScriptStringEncoder.Default;
80-
81-
// Assert
82-
Assert.Same(encoder1, encoder2);
83-
}
84-
8574
[Fact]
8675
public void JavaScriptStringEncode_AllRangesAllowed_StillEncodesForbiddenChars_Simple_Escaping() {
8776
// The following two calls could be simply InlineData to the Theory below

src/System.Text.Encodings.Web/tests/UrlEncoderTests.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,6 @@ public void Default_EquivalentToBasicLatin()
7575
}
7676
}
7777

78-
[Fact]
79-
public void Default_ReturnsSingletonInstance()
80-
{
81-
// Act
82-
UrlEncoder encoder1 = UrlEncoder.Default;
83-
UrlEncoder encoder2 = UrlEncoder.Default;
84-
85-
// Assert
86-
Assert.Same(encoder1, encoder2);
87-
}
88-
8978
[Fact]
9079
public void UrlEncode_AllRangesAllowed_StillEncodesForbiddenChars()
9180
{

0 commit comments

Comments
 (0)