mirror of
https://github.com/NixOS/nix
synced 2025-07-07 14:21:48 +02:00
isValidSchemeName: Use regex
As requested by Eelco Dolstra. I think it used to be simpler.
(cherry picked from commit 4eaeda6604
)
This commit is contained in:
parent
598b0e2317
commit
ebdb6926fd
2 changed files with 8 additions and 12 deletions
|
@ -360,6 +360,11 @@ TEST(nix, isValidSchemeName) {
|
|||
ASSERT_FALSE(isValidSchemeName(".file"));
|
||||
ASSERT_FALSE(isValidSchemeName("-file"));
|
||||
ASSERT_FALSE(isValidSchemeName("1file"));
|
||||
// regex ok?
|
||||
ASSERT_FALSE(isValidSchemeName("\nhttp"));
|
||||
ASSERT_FALSE(isValidSchemeName("\nhttp\n"));
|
||||
ASSERT_FALSE(isValidSchemeName("http\n"));
|
||||
ASSERT_FALSE(isValidSchemeName("http "));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue