Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Convert duplicate InlineData to single shared MemberData method.
  • Loading branch information
carlossanlop authored and github-actions committed Mar 9, 2023
commit e15d0a22f3d4ce6b0683ac762513ebef1fd152be
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,7 @@ public void ExtractGlobalExtendedAttributesEntry_Throws()
}

[Theory]
[InlineData("key", "value")]
[InlineData("key ", "value ")]
[InlineData(" key", " value")]
[InlineData(" key ", " value ")]
[InlineData(" key spaced ", " value spaced ")]
[InlineData("many sla/s\\hes", "/////////////\\\\\\///////////")]
[InlineData("key", "va=lue")]
[InlineData("key", "=")]
[MemberData(nameof(GetPaxExtendedAttributesRoundtripTestData))]
public void GlobalExtendedAttribute_Roundtrips(string key, string value)
{
var stream = new MemoryStream();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,7 @@ public void TarReader_LeaveOpen_False_CopiedDataNotDisposed()
}

[Theory]
[InlineData("key", "value")]
[InlineData("key ", "value ")]
[InlineData(" key", " value")]
[InlineData(" key ", " value ")]
[InlineData(" key spaced ", " value spaced ")]
[InlineData("many sla/s\\hes", "/////////////\\\\\\///////////")]
[InlineData("key", "va=lue")]
[InlineData("key", "=")]
[MemberData(nameof(GetPaxExtendedAttributesRoundtripTestData))]
public void PaxExtendedAttribute_Roundtrips(string key, string value)
{
var stream = new MemoryStream();
Expand Down
12 changes: 12 additions & 0 deletions src/libraries/System.Formats.Tar/tests/TarTestsBase.Pax.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,17 @@ protected void VerifyExtendedAttributeTimestamps(PaxTarEntry pax)
VerifyExtendedAttributeTimestamp(pax, PaxEaATime, MinimumTime);
VerifyExtendedAttributeTimestamp(pax, PaxEaCTime, MinimumTime);
}

public static IEnumerable<object[]> GetPaxExtendedAttributesRoundtripTestData()
{
yield return new object[] { "key", "value" };
yield return new object[] { "key ", "value " };
yield return new object[] { " key", " value" };
yield return new object[] { " key ", " value " };
yield return new object[] { " key spaced ", " value spaced " };
yield return new object[] { "many sla/s\\hes", "/////////////\\\\\\///////////" };
yield return new object[] { "key", "va=lue" };
yield return new object[] { "key", "=" };
}
}
}