diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2023-04-14 20:45:11 -0400 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2023-04-14 20:45:11 -0400 |
commit | ee420ac64e7d1f51f5abcb069dbe84cd6ff707ce (patch) | |
tree | 98668c4cdac6640aee90a86acd644aaad862bb71 /src/libstore/tests | |
parent | 9e8f2090365a509656dead69bc91fb6615cf9d05 (diff) |
Legacy vs non-legacy `to_string`/`parse` for `DerivedPath`
As requested by @roberth, it is good to call out the specific instances
we care about, which is `!` for the RPC protocols, and `^` for humans.
This doesn't take advantage of parametricity as much, but since the
human and computer interfaces are good to decouple anyways (we don't
care if they drift further apart over time in the slightest) some
separation and slight duplication is fine.
Also, unit test both round trips.
Diffstat (limited to 'src/libstore/tests')
-rw-r--r-- | src/libstore/tests/derived-path.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libstore/tests/derived-path.cc b/src/libstore/tests/derived-path.cc index d1ac2c5e7..e6d32dbd0 100644 --- a/src/libstore/tests/derived-path.cc +++ b/src/libstore/tests/derived-path.cc @@ -53,6 +53,14 @@ TEST_F(DerivedPathTest, force_init) RC_GTEST_FIXTURE_PROP( DerivedPathTest, + prop_legacy_round_rip, + (const DerivedPath & o)) +{ + RC_ASSERT(o == DerivedPath::parseLegacy(*store, o.to_string_legacy(*store))); +} + +RC_GTEST_FIXTURE_PROP( + DerivedPathTest, prop_round_rip, (const DerivedPath & o)) { |