[commands] Use factories and decorators in Command tests (#7006)

This commit is contained in:
ハイドラント
2024-12-29 10:45:17 -06:00
committed by GitHub
parent e7dd5dca82
commit 78b6d61e88
30 changed files with 374 additions and 412 deletions

View File

@@ -2,6 +2,8 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#include <frc2/command/Commands.h>
#include "CommandTestBase.h"
#include "frc2/command/RunCommand.h"
@@ -13,9 +15,9 @@ TEST_F(RunCommandTest, RunCommandSchedule) {
int counter = 0;
RunCommand command([&counter] { counter++; }, {});
auto command = cmd::Run([&counter] { counter++; });
scheduler.Schedule(&command);
scheduler.Schedule(command);
scheduler.Run();
scheduler.Run();
scheduler.Run();