mirror of
https://github.com/NixOS/nix
synced 2025-06-30 11:43:15 +02:00
Fix another machine config parsing bug
We were ignorning the result of `trim`, and after my last change we were also trimmming too early.
This commit is contained in:
parent
d45067177e
commit
b74b0f4e1c
2 changed files with 19 additions and 4 deletions
|
@ -85,6 +85,20 @@ TEST(machines, getMachinesWithCommentsAndSemicolonSeparator) {
|
|||
EXPECT_THAT(actual, Contains(Field(&Machine::storeUri, AuthorityMatches("nix@scabby.labs.cs.uu.nl"))));
|
||||
}
|
||||
|
||||
TEST(machines, getMachinesWithFunnyWhitespace) {
|
||||
auto actual = Machine::parseConfig({},
|
||||
" # commment ; comment\n"
|
||||
" nix@scratchy.labs.cs.uu.nl ; nix@itchy.labs.cs.uu.nl \n"
|
||||
"\n \n"
|
||||
"\n ;;; \n"
|
||||
"\n ; ; \n"
|
||||
"nix@scabby.labs.cs.uu.nl\n\n");
|
||||
EXPECT_THAT(actual, SizeIs(3));
|
||||
EXPECT_THAT(actual, Contains(Field(&Machine::storeUri, AuthorityMatches("nix@scratchy.labs.cs.uu.nl"))));
|
||||
EXPECT_THAT(actual, Contains(Field(&Machine::storeUri, AuthorityMatches("nix@itchy.labs.cs.uu.nl"))));
|
||||
EXPECT_THAT(actual, Contains(Field(&Machine::storeUri, AuthorityMatches("nix@scabby.labs.cs.uu.nl"))));
|
||||
}
|
||||
|
||||
TEST(machines, getMachinesWithCorrectCompleteSingleBuilder) {
|
||||
auto actual = Machine::parseConfig({},
|
||||
"nix@scratchy.labs.cs.uu.nl i686-linux "
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue