Plan display file actions in app core

This commit is contained in:
2026-06-03 03:38:14 +02:00
parent 712c28068d
commit 4af55a7d3f
9 changed files with 116 additions and 4 deletions

View File

@@ -17,6 +17,20 @@ void picked_path_invokes_callback_for_nonempty_path(pp::tests::Harness& harness)
pp::app::plan_picked_path("D:/Paint/demo.ppi") == pp::app::PickedPathAction::invoke_callback);
}
void display_file_ignores_empty_path(pp::tests::Harness& harness)
{
PP_EXPECT(
harness,
pp::app::plan_display_file("") == pp::app::DisplayFileAction::ignore_empty_path);
}
void display_file_opens_nonempty_path(pp::tests::Harness& harness)
{
PP_EXPECT(
harness,
pp::app::plan_display_file("D:/Paint/export.png") == pp::app::DisplayFileAction::open_external_file);
}
}
int main()
@@ -24,5 +38,7 @@ int main()
pp::tests::Harness harness;
harness.run("picked path ignores empty path", picked_path_ignores_empty_path);
harness.run("picked path invokes callback for nonempty path", picked_path_invokes_callback_for_nonempty_path);
harness.run("display file ignores empty path", display_file_ignores_empty_path);
harness.run("display file opens nonempty path", display_file_opens_nonempty_path);
return harness.finish();
}