1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-08 19:46:02 +01:00

Fix some characterization tests

A few changes had cropped up with `_NIX_TEST_ACCEPT=1`:

1. Blake hashing test JSON had a different indentation

2. Store URI had improper non-quoted spaces

(1) was is just fixed, as we trust nlohmann JSON to parse JSON
correctly, regardless of whitespace.

For (2), the existing URL was made a read-only test, since we very much
wish to continue parsing such invalid URLs directly. And then the
original read/write test was updated to properly percent-encode the
space, as the normal form should be.
This commit is contained in:
John Ericson 2025-10-23 14:03:21 -04:00
parent 0a74b4905c
commit c87f29a0b6
5 changed files with 12 additions and 8 deletions

View file

@ -1 +1 @@
local://?root=/foo bar/baz
local://?root=/foo%20bar/baz

View file

@ -0,0 +1 @@
local://?root=/foo bar/baz

View file

@ -100,9 +100,12 @@ URI_TEST(local_1, localExample_1)
URI_TEST(local_2, localExample_2)
/* Test path with spaces */
/* Test path with encoded spaces */
URI_TEST(local_3, localExample_3)
/* Test path with spaces that are improperly not encoded */
URI_TEST_READ(local_3_no_percent, localExample_3)
URI_TEST_READ(local_shorthand_1, localExample_1)
URI_TEST_READ(local_shorthand_2, localExample_2)

View file

@ -1,5 +1,5 @@
{
"algorithm": "blake3",
"format": "base64",
"hash": "nnDuFEmWX7YtBJBAoe0G7Dd0MNpuwTFz58T//NKL6YA="
"algorithm": "blake3",
"format": "base64",
"hash": "nnDuFEmWX7YtBJBAoe0G7Dd0MNpuwTFz58T//NKL6YA="
}

View file

@ -1,5 +1,5 @@
{
"algorithm": "sha256",
"format": "base64",
"hash": "8OTC92xYkW7CWPJGhRvqCR0U1CR6L8PhhpRGGxgW4Ts="
"algorithm": "sha256",
"format": "base64",
"hash": "8OTC92xYkW7CWPJGhRvqCR0U1CR6L8PhhpRGGxgW4Ts="
}