16 lines
665 B
C++
16 lines
665 B
C++
// Regression: the CA installer header must compile with the vector-argv API.
|
|
// Test only unprivileged commands: do not install a CA or prompt for elevation.
|
|
#include "../src/cef/ca_installer.hpp"
|
|
#include <cassert>
|
|
#include <type_traits>
|
|
|
|
static_assert(std::is_same_v<decltype(CaInstaller::run(std::vector<std::string>{"true"})), bool>);
|
|
|
|
int main() {
|
|
assert(CaInstaller::run({"true"}));
|
|
assert(!CaInstaller::run({"false"}));
|
|
// Shell metacharacters must remain part of one argv entry.
|
|
const auto result = bg_process::run({"printf", "%s", "a b;$(echo unsafe)'\""});
|
|
assert(result.ok());
|
|
assert(result.output == "a b;$(echo unsafe)'\"");
|
|
}
|