diff options
author | Pierre Bourdon <delroth@gmail.com> | 2024-05-18 07:26:26 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@lix-systems> | 2024-05-18 07:26:26 +0000 |
commit | d1c8fd3b0981a53f122dc4b9e5cda705de3c1ac2 (patch) | |
tree | 6135f2fd7821e373063481f3f694b73a77a2e858 /tests/unit/libstore/derived-path.cc | |
parent | 7a3745b07607d3fc85fb5a0a08832ab078080884 (diff) | |
parent | 5a1824ebe1fcdeff86b57a13a33d6428e89e4bce (diff) |
Merge "derived-path: refuse built derived path with a non-derivation base" into main
Diffstat (limited to 'tests/unit/libstore/derived-path.cc')
-rw-r--r-- | tests/unit/libstore/derived-path.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/unit/libstore/derived-path.cc b/tests/unit/libstore/derived-path.cc index c62d79a78..ffa541e9f 100644 --- a/tests/unit/libstore/derived-path.cc +++ b/tests/unit/libstore/derived-path.cc @@ -77,6 +77,15 @@ TEST_F(DerivedPathTest, built_built_xp) { MissingExperimentalFeature); } +/** + * Built paths with a non-derivation base should fail parsing. + */ +TEST_F(DerivedPathTest, non_derivation_base) { + ASSERT_THROW( + DerivedPath::parse(*store, "/nix/store/g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-x^foo"), + InvalidPath); +} + #ifndef COVERAGE RC_GTEST_FIXTURE_PROP( |