mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-11-27 15:49:52 -05:00
Every command takes JSON arguments and has one function for a person and for automation: with no arguments it does what a person's pick does, and with arguments it runs silently. The Design tab's CAD tools are commands that call_tool runs, and they show as Speed Dial tiles on the Design tab.
366 lines
19 KiB
C++
366 lines
19 KiB
C++
#include <catch2/catch_message.hpp>
|
|
#include <catch2/catch_test_macros.hpp>
|
|
#include <catch2/generators/catch_generators.hpp>
|
|
|
|
#include "slic3r/GUI/Mcp/McpReplay.hpp"
|
|
#include "slic3r/GUI/Mcp/McpReplaySummary.hpp"
|
|
|
|
#include <nlohmann/json.hpp>
|
|
|
|
#include <optional>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
using namespace Slic3r::GUI::Mcp;
|
|
using nlohmann::json;
|
|
|
|
namespace {
|
|
|
|
using Flags = std::vector<std::string>;
|
|
|
|
const Flags kEveryFlag{"writes_file", "changes_presets", "replaces_project", "sends_to_printer"};
|
|
|
|
// Describes the one step of a replay built around `step`, run from C:/replays with output in C:/out.
|
|
StepDescription describe(const std::string& step, const std::string& vars = "{}")
|
|
{
|
|
std::string err;
|
|
const auto replay = parse_replay(R"({"orca_replay": 1, "vars": )" + vars + R"(, "steps": [)" + step + "]}", err);
|
|
INFO(err);
|
|
REQUIRE(replay.has_value());
|
|
ReplayContext ctx;
|
|
ctx.replay_dir = "C:/replays";
|
|
ctx.out_dir = "C:/out";
|
|
return describe_step(replay->steps[0], *replay, ctx);
|
|
}
|
|
|
|
Flags flags_of(const StepDescription& d)
|
|
{
|
|
Flags out;
|
|
for (StepFlag f : d.flags)
|
|
out.push_back(flag_id(f));
|
|
return out;
|
|
}
|
|
|
|
// An absolute path on this platform: Speed Dial commands name files only by absolute paths, and
|
|
// "C:/a" is relative outside Windows.
|
|
std::string abs_path(const std::string& name)
|
|
{
|
|
#ifdef _WIN32
|
|
return "C:/a/" + name;
|
|
#else
|
|
return "/a/" + name;
|
|
#endif
|
|
}
|
|
|
|
std::string action(const std::string& id, const json& command_args = json::object())
|
|
{
|
|
json args{{"id", id}};
|
|
if (!command_args.empty())
|
|
args["args"] = command_args;
|
|
return json{{"tool", "run_action"}, {"args", args}}.dump();
|
|
}
|
|
|
|
} // namespace
|
|
|
|
TEST_CASE("open_files is flagged by what it opens", "[Mcp]")
|
|
{
|
|
struct Case
|
|
{
|
|
std::string step;
|
|
std::string vars;
|
|
Flags flags;
|
|
std::string replace;
|
|
};
|
|
const Case c = GENERATE(values<Case>({
|
|
{R"({"tool": "open_files", "args": {"paths": ["C:/a/p.3mf"]}})", "{}", {"replaces_project"}, "checked"},
|
|
{R"({"tool": "open_files", "args": {"paths": ["C:/a/p.3mf"], "as": "geometry"}})", "{}", {}, ""},
|
|
{R"({"tool": "open_files", "args": {"paths": ["C:/a/p.3mf", "C:/a/b.stl"]}})", "{}", {}, ""},
|
|
{R"({"tool": "open_files", "args": {"paths": ["C:/a/b.stl"]}})", "{}", {}, ""},
|
|
{R"({"tool": "open_files", "args": {"paths": ["C:/a/m.step"]}})", "{}", {}, ""},
|
|
{R"({"tool": "open_files", "args": {"paths": ["C:/a/x.gcode"]}})", "{}", {"replaces_project"}, "app_asked"},
|
|
{R"({"tool": "open_files", "args": {"paths": ["${vars.project}"]}})", R"({"project": "C:/a/p.3mf"})",
|
|
{"replaces_project"}, "checked"},
|
|
}));
|
|
INFO(c.step);
|
|
const StepDescription d = describe(c.step, c.vars);
|
|
CHECK(flags_of(d) == c.flags);
|
|
CHECK(d.replace == c.replace);
|
|
}
|
|
|
|
TEST_CASE("project tools replace the project after checking for unsaved changes", "[Mcp]")
|
|
{
|
|
const StepDescription fresh = describe(R"({"tool": "new_project", "args": {"discard_changes": true}})");
|
|
CHECK(flags_of(fresh) == Flags{"replaces_project"});
|
|
CHECK(fresh.replace == "checked");
|
|
|
|
const StepDescription calib = describe(R"({"tool": "generate_calibration_test", "args": {"test": "temperature"}})");
|
|
CHECK(flags_of(calib) == Flags{"changes_presets", "replaces_project"});
|
|
CHECK(calib.replace == "checked");
|
|
|
|
// Silent with its defaults, it checks as with arguments; with none, it asks as New Project does.
|
|
CHECK(describe(R"({"tool": "new_project", "args": {"silent": true}})").replace == "checked");
|
|
const StepDescription asked = describe(R"({"tool": "new_project", "args": {}})");
|
|
CHECK(flags_of(asked) == Flags{"replaces_project"});
|
|
CHECK(asked.replace == "app_asked");
|
|
}
|
|
|
|
TEST_CASE("a command called by name is described as its tile is", "[Mcp]")
|
|
{
|
|
const auto [key, args, flags] = GENERATE_COPY(table<std::string, json, Flags>({
|
|
{"load_project", {{"path", abs_path("p.3mf")}}, {"replaces_project"}},
|
|
{"export_stl", {{"path", abs_path("a.stl")}}, {"writes_file"}},
|
|
{"sync_presets", json::object(), {"changes_presets"}},
|
|
}));
|
|
INFO(key << " " << args.dump());
|
|
const StepDescription by_name = describe(json{{"tool", key}, {"args", args}}.dump());
|
|
const StepDescription tile = describe(action("orca_command:" + key + ":orca", args));
|
|
CHECK(flags_of(by_name) == flags);
|
|
CHECK(flags_of(by_name) == flags_of(tile));
|
|
CHECK(by_name.replace == tile.replace);
|
|
CHECK(by_name.what == tile.what);
|
|
CHECK(describe_call(key, args) == tile.what);
|
|
}
|
|
|
|
TEST_CASE("speed dial actions are flagged by their id", "[Mcp]")
|
|
{
|
|
struct Case
|
|
{
|
|
std::string id;
|
|
json args;
|
|
Flags flags;
|
|
std::string replace;
|
|
};
|
|
const json none = json::object();
|
|
const Case c = GENERATE_COPY(values<Case>({
|
|
{"orca_command:calib_flow_ratio:orca", none, {"changes_presets", "replaces_project"}, "app_asked"},
|
|
{"orca_command:send_gcode:orca", none, {"sends_to_printer"}, ""},
|
|
{"orca_command:open_preferences:orca", none, {}, ""},
|
|
{"orca_command:slice_all:orca", none, {}, ""},
|
|
{"orca_command:export_gcode:orca", {{"path", "C:/x/a.gcode"}}, {"writes_file"}, ""},
|
|
{"orca_command:export_gcode:orca", none, {"writes_file"}, ""},
|
|
{"orca_command:export_config:orca", {{"path", "C:/x"}}, {"writes_file"}, ""},
|
|
{"orca_command:obj_set_instances:orca", {{"count", 3}}, {}, ""},
|
|
{"orca_command:save_project_as:orca", {{"path", "C:/x/a.3mf"}, {"overwrite", true}}, {"writes_file"}, ""},
|
|
{"orca_command:new_project:orca", none, {"replaces_project"}, "app_asked"},
|
|
{"orca_command:import_file:orca", {{"path", abs_path("p.3mf")}}, {}, ""},
|
|
{"orca_command:import_file:orca", {{"path", abs_path("x.gcode")}}, {}, ""},
|
|
{"orca_command:import_file:orca", {{"path", abs_path("b.stl")}}, {}, ""},
|
|
{"orca_recent_project:C:/p/a.3mf:orca", none, {"replaces_project"}, "app_asked"},
|
|
{"orca_plate_goto:1:orca", none, {}, ""},
|
|
{"orca_setting:layer_height:1", none, {}, ""},
|
|
{"plugin_replay_action:tool:plugin", none, kEveryFlag, "app_asked"},
|
|
{"plugin_page_action:page:plugin", none, kEveryFlag, "app_asked"},
|
|
}));
|
|
INFO(c.id << " " << c.args.dump());
|
|
const StepDescription d = describe(action(c.id, c.args));
|
|
CHECK(flags_of(d) == c.flags);
|
|
CHECK(d.replace == c.replace);
|
|
}
|
|
|
|
TEST_CASE("plugin actions are taken to answer dialogs", "[Mcp]")
|
|
{
|
|
CHECK(describe(action("plugin_replay_action:tool:plugin")).answers_dialogs);
|
|
CHECK_FALSE(describe(action("orca_command:new_project:orca")).answers_dialogs);
|
|
}
|
|
|
|
TEST_CASE("speed dial actions describe their command and file", "[Mcp]")
|
|
{
|
|
const json none = json::object();
|
|
const auto [id, args, what] = GENERATE_COPY(table<std::string, json, json>({
|
|
{"orca_command:import_file:orca", {{"path", abs_path("p.3mf")}}, {{"kind", "command"}, {"key", "import_file"}, {"args", {"path: p.3mf"}}}},
|
|
{"orca_command:save_project_as:orca", {{"path", abs_path("p.3mf")}, {"overwrite", true}},
|
|
{{"kind", "command"}, {"key", "save_project_as"}, {"args", {"overwrite: true", "path: p.3mf"}}}},
|
|
{"orca_command:import_file:orca", {{"path", "models/x.gcode"}}, {{"kind", "command"}, {"key", "import_file"}, {"args", {"path: x.gcode"}}}},
|
|
{"orca_command:go_to_layer:orca", {{"percent", 50}}, {{"kind", "command"}, {"key", "go_to_layer"}, {"args", {"percent: 50"}}}},
|
|
{"orca_command:add_primitive_cube:orca", {{"size", {20, 20, 20}}},
|
|
{{"kind", "command"}, {"key", "add_primitive_cube"}, {"args", {"size: [20,20,20]"}}}},
|
|
{"orca_command:slice_all:orca", none, {{"kind", "command"}, {"key", "slice_all"}}},
|
|
{"orca_recent_project:C:/p/a.3mf:orca", none, {{"kind", "recent_project"}, {"name", "a.3mf"}}},
|
|
{"orca_setting:layer_height:1", none, {{"kind", "value"}, {"text", "layer_height"}}},
|
|
{"plugin_replay_action:tool:plugin", none, {{"kind", "value"}, {"text", "plugin_replay_action:tool:plugin"}}},
|
|
}));
|
|
INFO(id << " " << args.dump());
|
|
CHECK(describe(action(id, args)).what == what);
|
|
}
|
|
|
|
TEST_CASE("files written inside the output folder are not flagged", "[Mcp]")
|
|
{
|
|
const auto [step, flags] = GENERATE(table<std::string, Flags>({
|
|
{R"({"tool": "screenshot", "args": {"save_path": "C:/out/a.png"}})", {}},
|
|
{R"({"tool": "screenshot", "args": {"save_path": "${out_dir}/a.png"}})", {}},
|
|
{R"({"tool": "screenshot", "args": {"save_path": "C:/x/a.png"}})", {"writes_file"}},
|
|
{R"({"tool": "screenshot", "args": {"target": "canvas"}})", {}},
|
|
{R"({"tool": "export_replay", "args": {"path": "${out_dir}/s.json"}})", {}},
|
|
{R"({"tool": "export_replay", "args": {"path": "C:/x/s.json"}})", {"writes_file"}},
|
|
{R"({"tool": "pick_gizmo_file", "args": {"action": "svg_save_as", "path": "C:/x/a.svg"}})", {"writes_file"}},
|
|
{R"({"tool": "pick_gizmo_file", "args": {"action": "svg_change", "path": "C:/x/a.svg"}})", {}},
|
|
// A path rule may answer a save picker, so its path is a file the step may write.
|
|
{R"({"tool": "auto_answer_dialogs", "args": {"rules": [{"match": "Save", "button": "ok", "path": "C:/x/a.3mf"}]}})", {"writes_file"}},
|
|
{R"({"tool": "auto_answer_dialogs", "args": {"rules": [{"match": "Save", "button": "ok", "path": "${out_dir}/a.3mf"}]}})", {}},
|
|
{R"({"tool": "auto_answer_dialogs", "args": {"rules": [{"match": "Save", "button": "cancel"}]}})", {}},
|
|
{R"({"tool": "auto_answer_dialogs", "args": {"rules": [{"match": "Discard", "button": "no"}, {"match": "Save", "button": "ok", "path": "C:/x/a.3mf", "overwrite": true}]}})",
|
|
{"writes_file"}},
|
|
{R"({"tool": "export", "args": {"path": "${out_dir}/a.gcode"}})", {"writes_file"}},
|
|
{R"({"tool": "save_preset", "args": {"type": "filament", "name": "Mine"}})", {"changes_presets"}},
|
|
{R"({"tool": "delete_preset", "args": {"type": "filament", "name": "Mine"}})", {"changes_presets"}},
|
|
}));
|
|
INFO(step);
|
|
CHECK(flags_of(describe(step)) == flags);
|
|
}
|
|
|
|
TEST_CASE("steps that can answer a dialog are told apart", "[Mcp]")
|
|
{
|
|
const auto [tool, answers] = GENERATE(table<std::string, bool>({
|
|
{"auto_answer_dialogs", true},
|
|
{"answer_dialog", true},
|
|
{"click", true},
|
|
{"press_keys", true},
|
|
{"set_widget_value", false},
|
|
{"mouse_gesture", false},
|
|
{"run_javascript", false},
|
|
}));
|
|
INFO(tool);
|
|
const StepDescription d = describe(json{{"tool", tool}}.dump());
|
|
CHECK(d.answers_dialogs == answers);
|
|
CHECK(flags_of(d).empty());
|
|
}
|
|
|
|
TEST_CASE("nested replays join their steps' descriptions", "[Mcp]")
|
|
{
|
|
const StepDescription replacing = describe(
|
|
R"({"tool": "run_replay", "args": {"replay": {"orca_replay": 1, "steps": [{"tool": "new_project", "args": {"discard_changes": true}}]}}})");
|
|
CHECK(flags_of(replacing) == Flags{"replaces_project"});
|
|
CHECK(replacing.replace == "checked");
|
|
CHECK(replacing.what == json{{"kind", "replay"}, {"steps", 1}});
|
|
|
|
// An inline replay given as JSON text, comments included, reads as its object does.
|
|
const std::string text = "// starts over\n" R"({"orca_replay": 1, "steps": [{"tool": "new_project", "args": {"discard_changes": true}}]})";
|
|
const StepDescription as_text = describe(json{{"tool", "run_replay"}, {"args", {{"replay", text}}}}.dump());
|
|
CHECK(flags_of(as_text) == Flags{"replaces_project"});
|
|
CHECK(as_text.what == json{{"kind", "replay"}, {"steps", 1}});
|
|
|
|
const StepDescription own_output = describe(
|
|
R"({"tool": "run_replay", "args": {"replay": {"orca_replay": 1, "steps": [{"tool": "screenshot", "args": {"save_path": "${out_dir}/n.png"}}]}}})");
|
|
CHECK(flags_of(own_output).empty());
|
|
|
|
// The outer replay substitutes an inline replay's placeholders before the nested run starts, as
|
|
// run_replay does: the step's own vars come too late, and its out_dir doesn't move ${out_dir}.
|
|
const StepDescription outer_vars = describe(
|
|
R"({"tool": "run_replay", "args": {"replay": {"orca_replay": 1, "steps": [{"tool": "open_files", "args": {"paths": ["${vars.p}"]}}]}}})",
|
|
R"({"p": "C:/a/p.3mf"})");
|
|
CHECK(flags_of(outer_vars) == Flags{"replaces_project"});
|
|
CHECK(outer_vars.replace == "checked");
|
|
|
|
const StepDescription step_vars = describe(
|
|
R"({"tool": "run_replay", "args": {"vars": {"p": "C:/a/p.3mf"}, "replay": {"orca_replay": 1, "vars": {"p": "C:/a/q.3mf"}, "steps": [{"tool": "open_files", "args": {"paths": ["${vars.p}"]}}]}}})");
|
|
CHECK(flags_of(step_vars).empty());
|
|
CHECK(step_vars.replace == "");
|
|
|
|
const StepDescription own_folder = describe(
|
|
R"({"tool": "run_replay", "args": {"out_dir": "C:/elsewhere", "replay": {"orca_replay": 1, "steps": [{"tool": "screenshot", "args": {"save_path": "${out_dir}/n.png"}}]}}})");
|
|
CHECK(flags_of(own_folder).empty());
|
|
|
|
const StepDescription mixed = describe(
|
|
R"({"tool": "run_replay", "args": {"replay": {"orca_replay": 1, "steps": [{"tool": "run_action", "args": {"id": "orca_command:new_project:orca"}}, {"tool": "new_project", "args": {"silent": true}}]}}})");
|
|
CHECK(mixed.replace == "checked");
|
|
|
|
const StepDescription clicking = describe(
|
|
R"({"tool": "run_replay", "args": {"replay": {"orca_replay": 1, "steps": [{"tool": "click", "args": {"target": {"label": "No"}}}]}}})");
|
|
CHECK(clicking.answers_dialogs);
|
|
|
|
// Five levels of nesting: past the inspection depth, so the effect can't be read.
|
|
std::string deep = R"({"orca_replay": 1, "steps": [{"tool": "new_project"}]})";
|
|
for (int i = 0; i < 5; ++i)
|
|
deep = R"({"orca_replay": 1, "steps": [{"tool": "run_replay", "args": {"replay": )" + deep + "}}]}";
|
|
const StepDescription too_deep = describe(R"({"tool": "run_replay", "args": {"replay": )" + deep + "}}");
|
|
CHECK(flags_of(too_deep) == kEveryFlag);
|
|
CHECK(too_deep.replace == "checked");
|
|
CHECK(too_deep.answers_dialogs);
|
|
CHECK(too_deep.what == json{{"kind", "replay"}, {"steps", 1}});
|
|
|
|
const StepDescription invalid = describe(R"({"tool": "run_replay", "args": {"replay": {"orca_replay": 1, "steps": [{"tool": 3}]}}})");
|
|
CHECK(flags_of(invalid) == kEveryFlag);
|
|
REQUIRE(invalid.what.value("kind", "") == "value");
|
|
CHECK(invalid.what.value("text", "").find("step 1") != std::string::npos);
|
|
|
|
const StepDescription broken_text = describe(json{{"tool", "run_replay"}, {"args", {{"replay", "{\"orca_replay\": 1,\n \"steps\": ["}}}}.dump());
|
|
CHECK(flags_of(broken_text) == kEveryFlag);
|
|
REQUIRE(broken_text.what.value("kind", "") == "value");
|
|
CHECK(broken_text.what.value("text", "").find("line 2") != std::string::npos);
|
|
|
|
const StepDescription missing = describe(R"({"tool": "run_replay", "args": {"path": "C:/no/such/replay.json"}})");
|
|
CHECK(flags_of(missing) == kEveryFlag);
|
|
CHECK(missing.replace == "checked");
|
|
CHECK(missing.answers_dialogs);
|
|
CHECK(missing.what == json{{"kind", "files"}, {"names", {"replay.json"}}});
|
|
}
|
|
|
|
// The runner describes steps without the saved jobs a single step runs with: ${jobs.NAME} resolves
|
|
// to a job id such as "j12", never a path, so the effects read the same either way.
|
|
TEST_CASE("saved jobs don't change a step's flags", "[Mcp]")
|
|
{
|
|
const std::string step = GENERATE(as<std::string>{}, R"({"tool": "open_files", "args": {"paths": ["${jobs.p}"]}})",
|
|
R"({"tool": "screenshot", "args": {"save_path": "${jobs.p}/a.png"}})",
|
|
R"({"tool": "run_action", "args": {"id": "orca_command:import_file:orca", "args": {"path": "${jobs.p}"}}})");
|
|
INFO(step);
|
|
std::string err;
|
|
const auto replay = parse_replay(R"({"orca_replay": 1, "steps": [)" + step + "]}", err);
|
|
REQUIRE(replay.has_value());
|
|
ReplayContext without;
|
|
without.out_dir = "C:/out";
|
|
ReplayContext with = without;
|
|
with.jobs = json{{"p", "j12"}};
|
|
const StepDescription a = describe_step(replay->steps[0], *replay, without);
|
|
const StepDescription b = describe_step(replay->steps[0], *replay, with);
|
|
CHECK(flags_of(a) == flags_of(b));
|
|
CHECK(a.replace == b.replace);
|
|
CHECK(a.answers_dialogs == b.answers_dialogs);
|
|
}
|
|
|
|
TEST_CASE("a step's what names what it acts on", "[Mcp]")
|
|
{
|
|
const auto [step, what] = GENERATE(table<std::string, json>({
|
|
{R"({"tool": "set_settings", "args": {"values": {"layer_height": 0.12, "wall_loops": "3"}}})",
|
|
{{"kind", "settings"}, {"pairs", {"layer_height = 0.12", "wall_loops = 3"}}}},
|
|
{R"({"tool": "open_files", "args": {"paths": ["C:/m/3DBenchy.stl", "C:/m/cube.stl"]}})",
|
|
{{"kind", "files"}, {"names", {"3DBenchy.stl", "cube.stl"}}}},
|
|
{R"({"tool": "screenshot", "args": {"save_path": "${out_dir}/preview.png"}})", {{"kind", "files"}, {"names", {"preview.png"}}}},
|
|
{R"({"tool": "slice"})", {{"kind", "plates"}, {"plates", "current"}}},
|
|
{R"({"tool": "slice", "args": {"plates": 2}})", {{"kind", "plates"}, {"plates", 2}}},
|
|
{R"({"tool": "arrange"})", {{"kind", "plates"}, {"plates", "all"}}},
|
|
{R"({"tool": "select_preset", "args": {"type": "filament", "name": "Generic PLA"}})", {{"kind", "preset"}, {"name", "Generic PLA"}}},
|
|
{R"({"tool": "wait", "args": {"for": "idle"}})", {{"kind", "value"}, {"text", "idle"}}},
|
|
{R"({"tool": "answer_dialog", "args": {"button": "no"}})", {{"kind", "value"}, {"text", "no"}}},
|
|
{R"({"tool": "transform", "args": {"object": 1}})", {{"kind", "value"}, {"text", "object: 1"}}},
|
|
{R"({"tool": "get_app_state"})", nullptr},
|
|
}));
|
|
INFO(step);
|
|
CHECK(describe(step).what == what);
|
|
}
|
|
|
|
TEST_CASE("a step with an expect checks its result", "[Mcp]")
|
|
{
|
|
CHECK(describe(R"({"tool": "slice", "expect": {"/plates/0/outcome": {"eq": "ok"}}})").checks_result);
|
|
CHECK_FALSE(describe(R"({"tool": "slice"})").checks_result);
|
|
}
|
|
|
|
TEST_CASE("results are described from the tools' real replies", "[Mcp]")
|
|
{
|
|
CHECK(describe_result("open_files", {{"objects", 1}, {"names", {"Benchy"}}, {"plates", 1}}) == json{{"kind", "objects"}, {"count", 1}});
|
|
CHECK(describe_result("generate_calibration_test", {{"objects", 3}, {"plates", 1}}) == json{{"kind", "objects"}, {"count", 3}});
|
|
CHECK(describe_result("open_files", {{"opened", "gcode"}, {"path", "C:/a/x.gcode"}}) == json{{"kind", "file"}, {"name", "x.gcode"}});
|
|
CHECK(describe_result("slice", {{"plates", {{{"index", 0}, {"outcome", "ok"}}, {{"index", 1}, {"outcome", "error"}}}}}) ==
|
|
json{{"kind", "plates"}, {"ok", 1}, {"other", 1}});
|
|
CHECK(describe_result("screenshot", {{"path", "C:/out/a.png"}}) == json{{"kind", "file"}, {"name", "a.png"}});
|
|
CHECK(describe_result("pick_gizmo_file", {{"saved", "C:/x/a.svg"}}) == json{{"kind", "file"}, {"name", "a.svg"}});
|
|
CHECK(describe_result("run_replay", {{"passed", false}, {"failed_step", 2}, {"steps", json::array()}}) ==
|
|
json{{"kind", "replay"}, {"passed", false}, {"failed_step", 2}});
|
|
CHECK(describe_result("run_replay", {{"passed", true}, {"steps", json::array()}}) == json{{"kind", "replay"}, {"passed", true}});
|
|
CHECK(describe_result("get_app_state", {{"ready", true}}).is_null());
|
|
|
|
CHECK(result_files({{"saved", "C:/x/a.svg"}}) == std::vector<std::string>{"C:/x/a.svg"});
|
|
CHECK(result_files({{"path", "C:/out/a.png"}}) == std::vector<std::string>{"C:/out/a.png"});
|
|
CHECK(result_files({{"path", ""}}).empty());
|
|
CHECK(result_files(json::object()).empty());
|
|
}
|