mirror of
https://github.com/actions/runner.git
synced 2025-12-13 00:36:29 +00:00
Handle escaped '%' in commands data section (#200)
This commit is contained in:
@@ -51,6 +51,19 @@ namespace GitHub.Runner.Common.Tests.Worker
|
||||
Assert.True(ActionCommand.TryParse(message, commands, out verify));
|
||||
Assert.True(IsEqualCommand(hc, test, verify));
|
||||
|
||||
message = "";
|
||||
test = null;
|
||||
verify = null;
|
||||
//##[do-something k1=%253B=%250D=%250A=%255D;]%253B-%250D-%250A-%255D
|
||||
message = "##[do-something k1=%253B=%250D=%250A=%255D;]%253B-%250D-%250A-%255D";
|
||||
test = new ActionCommand("do-something")
|
||||
{
|
||||
Data = "%3B-%0D-%0A-%5D",
|
||||
};
|
||||
test.Properties.Add("k1", "%3B=%0D=%0A=%5D");
|
||||
Assert.True(ActionCommand.TryParse(message, commands, out verify));
|
||||
Assert.True(IsEqualCommand(hc, test, verify));
|
||||
|
||||
message = "";
|
||||
test = null;
|
||||
verify = null;
|
||||
@@ -109,7 +122,7 @@ namespace GitHub.Runner.Common.Tests.Worker
|
||||
message = "";
|
||||
test = null;
|
||||
verify = null;
|
||||
//::do-something k1=%3B=%0D=%0A=%5D;::%3B-%0D-%0A-%5D
|
||||
//::do-something k1=;=%2C=%0D=%0A=]=%3A,::;-%0D-%0A-]-:-,
|
||||
message = "::do-something k1=;=%2C=%0D=%0A=]=%3A,::;-%0D-%0A-]-:-,";
|
||||
test = new ActionCommand("do-something")
|
||||
{
|
||||
@@ -119,6 +132,19 @@ namespace GitHub.Runner.Common.Tests.Worker
|
||||
Assert.True(ActionCommand.TryParseV2(message, commands, out verify));
|
||||
Assert.True(IsEqualCommand(hc, test, verify));
|
||||
|
||||
message = "";
|
||||
test = null;
|
||||
verify = null;
|
||||
//::do-something k1=;=%252C=%250D=%250A=]=%253A,::;-%250D-%250A-]-:-,
|
||||
message = "::do-something k1=;=%252C=%250D=%250A=]=%253A,::;-%250D-%250A-]-:-,";
|
||||
test = new ActionCommand("do-something")
|
||||
{
|
||||
Data = ";-%0D-%0A-]-:-,",
|
||||
};
|
||||
test.Properties.Add("k1", ";=%2C=%0D=%0A=]=%3A");
|
||||
Assert.True(ActionCommand.TryParseV2(message, commands, out verify));
|
||||
Assert.True(IsEqualCommand(hc, test, verify));
|
||||
|
||||
message = "";
|
||||
test = null;
|
||||
verify = null;
|
||||
|
||||
Reference in New Issue
Block a user