mirror of
https://github.com/actions/runner.git
synced 2026-07-07 21:26:08 +08:00
Address Copilot review feedback
- Remove the redundant second `TrimEnd('\n')` from the return path.
The earlier trim already removes any trailing newline before the
`\n...` doc-end check; the marker-removal substring does not
re-introduce one, so the second trim was dead code.
- Surface full exception (`ex.ToString()`) in the test round-trip
helper so YAML parse failures show stack + inner exception, not
just the top-level message.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -57,7 +57,7 @@ namespace GitHub.Runner.Worker.Dap
|
||||
{
|
||||
raw = raw.Substring(0, raw.Length - DocEndMarker.Length);
|
||||
}
|
||||
return raw.TrimEnd('\n');
|
||||
return raw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace GitHub.Runner.Common.Tests.Worker
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new Xunit.Sdk.XunitException(
|
||||
$"Formatted scalar did not round-trip as valid YAML.\nInput: '{value}'\nFormatted: '{scalar}'\nFull YAML:\n{yaml}\nError: {ex.Message}");
|
||||
$"Formatted scalar did not round-trip as valid YAML.\nInput: '{value}'\nFormatted: '{scalar}'\nFull YAML:\n{yaml}\nError: {ex}");
|
||||
}
|
||||
Assert.NotNull(doc);
|
||||
Assert.True(doc.ContainsKey("k"), $"missing key in parsed doc. Formatted: '{scalar}'");
|
||||
|
||||
Reference in New Issue
Block a user