mirror of
https://github.com/NixOS/nix.git
synced 2024-11-22 14:52:55 +00:00
808082ea03
Progress towards #10766 I thought that #10768 achieved, but when I went to use this stuff (in Hydra), turns out it did not. (Those `using FooConfig;` lines were not working --- they are so finicky!) This PR gets the job done, and adds some trivial unit tests to make sure I did what I intended. I had to add add a header to expose `SSHStoreConfig`, after which the preexisting `ssh-store-config.*` were very confusingly named files, so I renamed them to `common-ssh-store-config.hh` to match the type defined therein.
27 lines
475 B
C++
27 lines
475 B
C++
#include <gtest/gtest.h>
|
|
|
|
#include "ssh-store.hh"
|
|
|
|
namespace nix {
|
|
|
|
TEST(SSHStore, constructConfig)
|
|
{
|
|
SSHStoreConfig config{
|
|
"ssh",
|
|
"localhost",
|
|
StoreConfig::Params{
|
|
{
|
|
"remote-program",
|
|
// TODO #11106, no more split on space
|
|
"foo bar",
|
|
},
|
|
}};
|
|
EXPECT_EQ(
|
|
config.remoteProgram.get(),
|
|
(Strings{
|
|
"foo",
|
|
"bar",
|
|
}));
|
|
}
|
|
}
|