mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-29 13:04:59 +00:00
test: add jump combo planner and timing contracts
This commit is contained in:
parent
ba1dc32ccb
commit
eb9d6ce356
7 changed files with 328 additions and 1 deletions
|
|
@ -32,7 +32,7 @@ internal static class PathingContractAssert
|
|||
internal static void TimingMatches(PathingTimingBudget budget, PathingScenarioResult result)
|
||||
{
|
||||
if (!result.Completed)
|
||||
throw new XunitException("navigation did not complete");
|
||||
throw new XunitException($"navigation did not complete\n{Format(result, budget)}");
|
||||
|
||||
if (result.ReplanCount != 0)
|
||||
throw new XunitException($"expected 0 replans, saw {result.ReplanCount}\n{Format(result, budget)}");
|
||||
|
|
@ -53,6 +53,7 @@ internal static class PathingContractAssert
|
|||
private static string Format(PathingScenarioResult result, PathingTimingBudget budget)
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.AppendLine($"completed={result.Completed} replans={result.ReplanCount}");
|
||||
sb.AppendLine($"route actual={result.TotalTicks} expected={budget.ExpectedTotalTicks} max={budget.MaxTotalTicks}");
|
||||
for (int i = 0; i < result.SegmentRuns.Count; i++)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue