cli-test: Disable normalizing paths

The normalization of paths was converting valid `\n` characters to `/n`.
This had not been noticed until codespell suggest the change of
`/ndefined` to be `/undefined`.

Use `Assert::normalize_paths(false)` to disable this behaviour.
This commit is contained in:
Fintan Halpenny 2026-06-03 11:36:39 +02:00
parent b397b1a249
commit e4a16dc40a
3 changed files with 27 additions and 25 deletions

View File

@ -399,7 +399,9 @@ impl TestFormula {
} }
pub fn run(&mut self) -> Result<bool, io::Error> { pub fn run(&mut self) -> Result<bool, io::Error> {
let assert = Assert::new().redact_with(self.subs.clone()); let assert = Assert::new()
.normalize_paths(false)
.redact_with(self.subs.clone());
let mut runner = TestRunner::new(self); let mut runner = TestRunner::new(self);
fs::create_dir_all(&self.cwd)?; fs::create_dir_all(&self.cwd)?;

View File

@ -69,7 +69,7 @@ $ rad config schema
"default": "https://radicle.network/nodes/$host/$rid$path" "default": "https://radicle.network/nodes/$host/$rid$path"
}, },
"preferredSeeds": { "preferredSeeds": {
"description": "Preferred seeds. These seeds will be used for explorer links/nand in other situations when a seed needs to be chosen.", "description": "Preferred seeds. These seeds will be used for explorer links\nand in other situations when a seed needs to be chosen.",
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/$defs/ConnectAddress" "$ref": "#/$defs/ConnectAddress"
@ -146,7 +146,7 @@ $ rad config schema
} }
}, },
"Pinned": { "Pinned": {
"description": "Pinned content. This can be used to pin certain content when/nlisting, e.g. pin repositories on a web client.", "description": "Pinned content. This can be used to pin certain content when\nlisting, e.g. pin repositories on a web client.",
"type": "object", "type": "object",
"properties": { "properties": {
"repositories": { "repositories": {
@ -217,7 +217,7 @@ $ rad config schema
} }
}, },
"connect": { "connect": {
"description": "Peers to connect to on startup./nConnections to these peers will be maintained.", "description": "Peers to connect to on startup.\nConnections to these peers will be maintained.",
"type": "array", "type": "array",
"uniqueItems": true, "uniqueItems": true,
"items": { "items": {
@ -312,7 +312,7 @@ $ rad config schema
"$ref": "#/$defs/Fetch" "$ref": "#/$defs/Fetch"
}, },
"secret": { "secret": {
"description": "Path to a file containing an Ed25519 secret key, in OpenSSH format, i.e./nwith the `-----BEGIN OPENSSH PRIVATE KEY-----` header. The corresponding/npublic key will be used as the Node ID./n/nA decryption password cannot be configured, but passed at runtime via/nthe environment variable `RAD_PASSPHRASE`.", "description": "Path to a file containing an Ed25519 secret key, in OpenSSH format, i.e.\nwith the `-----BEGIN OPENSSH PRIVATE KEY-----` header. The corresponding\npublic key will be used as the Node ID.\n\nA decryption password cannot be configured, but passed at runtime via\nthe environment variable `RAD_PASSPHRASE`.",
"type": [ "type": [
"string", "string",
"null" "null"
@ -337,7 +337,7 @@ $ rad config schema
"/radicle:1.9.0/", "/radicle:1.9.0/",
"/example:42.0.0/other-client:2.3.4/" "/example:42.0.0/other-client:2.3.4/"
], ],
"pattern": "^/([^:///s]+((:[^:///s]+))?/)+$" "pattern": "^/([^:/\\s]+((:[^:/\\s]+))?/)+$"
}, },
"PeerConfig": { "PeerConfig": {
"description": "Peer configuration.", "description": "Peer configuration.",
@ -403,7 +403,7 @@ $ rad config schema
] ]
}, },
{ {
"description": "Forward address to the next layer. Either this is the global proxy,/nor the operating system, via DNS.", "description": "Forward address to the next layer. Either this is the global proxy,\nor the operating system, via DNS.",
"type": "object", "type": "object",
"properties": { "properties": {
"mode": { "mode": {
@ -578,16 +578,16 @@ $ rad config schema
] ]
}, },
"RateLimit": { "RateLimit": {
"description": "Rate limits for a single connection./n/nRate limiting uses a token bucket for each peer. The capacity of the bucket/nis defined by [`RateLimit::capacity`], and refill rate of the bucket is/ndefined by [`RateLimit::fill_rate`].", "description": "Rate limits for a single connection.\n\nRate limiting uses a token bucket for each peer. The capacity of the bucket\nis defined by [`RateLimit::capacity`], and refill rate of the bucket is\ndefined by [`RateLimit::fill_rate`].",
"type": "object", "type": "object",
"properties": { "properties": {
"fillRate": { "fillRate": {
"description": "The fill rate of the token bucket, refills tokens based on the elapsed/ntime, in seconds./n/nFor example, if the fill rate is `0.2`, this is equivalent to 1 token/nper 5 seconds (0.2 × 5 = 1).", "description": "The fill rate of the token bucket, refills tokens based on the elapsed\ntime, in seconds.\n\nFor example, if the fill rate is `0.2`, this is equivalent to 1 token\nper 5 seconds (0.2 × 5 = 1).",
"type": "number", "type": "number",
"format": "double" "format": "double"
}, },
"capacity": { "capacity": {
"description": "The capacity of the token bucket, is the maximum number of tokens the bucket can hold./nThe bucket starts with the given capacity as the number of tokens./nFor each connection attempt, a token is removed from the bucket, while/nthe fill rate adds tokens back to the bucket./n/nFor example, a capacity of 3 will allow 3 connection attempts from a/ngiven peer. If 3 attempts are made before the bucket refills, i.e. the/npeer attempted connections in quick succession, then the third attempt/nwill be rejected.", "description": "The capacity of the token bucket, is the maximum number of tokens the bucket can hold.\nThe bucket starts with the given capacity as the number of tokens.\nFor each connection attempt, a token is removed from the bucket, while\nthe fill rate adds tokens back to the bucket.\n\nFor example, a capacity of 3 will allow 3 connection attempts from a\ngiven peer. If 3 attempts are made before the bucket refills, i.e. the\npeer attempted connections in quick succession, then the third attempt\nwill be rejected.",
"type": "integer", "type": "integer",
"format": "uint", "format": "uint",
"minimum": 0 "minimum": 0
@ -619,13 +619,13 @@ $ rad config schema
} }
}, },
"FetchPackSizeLimit": { "FetchPackSizeLimit": {
"description": "Limiter for byte streams./n/nDefault: 500MiB", "description": "Limiter for byte streams.\n\nDefault: 500MiB",
"$ref": "#/$defs/ByteSize" "$ref": "#/$defs/ByteSize"
}, },
"ByteSize": { "ByteSize": {
"description": "Byte quantities using unit prefixes according to SI or ISO/IEC 80000-13.", "description": "Byte quantities using unit prefixes according to SI or ISO/IEC 80000-13.",
"type": "string", "type": "string",
"pattern": "^//d+(//.//d+)? ((K|M|G|T|P)i?B?|B)$", "pattern": "^\\d+(\\.\\d+)? ((K|M|G|T|P)i?B?|B)$",
"examples": [ "examples": [
"7 G", "7 G",
"50.3 TiB", "50.3 TiB",
@ -711,7 +711,7 @@ $ rad config schema
} }
}, },
"Pragma": { "Pragma": {
"description": "Global SQLite pragma statements to make in order to configure SQLite itself,/nsee <https://sqlite.org/pragma.html>.", "description": "Global SQLite pragma statements to make in order to configure SQLite itself,\nsee <https://sqlite.org/pragma.html>.",
"type": "object", "type": "object",
"properties": { "properties": {
"journalMode": { "journalMode": {
@ -723,7 +723,7 @@ $ rad config schema
} }
}, },
"JournalMode": { "JournalMode": {
"description": "Value for a `journal_mode` pragma statement./nFor a description of all variants please refer to/n<https://sqlite.org/pragma.html#pragma_journal_mode>./nNote that when SQLite documentation talks about /"the application/",/nthe application linked against this crate, e.g. Radicle Node, Radicle CLI,/nand others, is meant.", "description": "Value for a `journal_mode` pragma statement.\nFor a description of all variants please refer to\n<https://sqlite.org/pragma.html#pragma_journal_mode>.\nNote that when SQLite documentation talks about \"the application\",\nthe application linked against this crate, e.g. Radicle Node, Radicle CLI,\nand others, is meant.",
"type": "string", "type": "string",
"enum": [ "enum": [
"DELETE", "DELETE",
@ -735,7 +735,7 @@ $ rad config schema
] ]
}, },
"Synchronous": { "Synchronous": {
"description": "Value for a `synchronous` pragma statement./nFor a description of all variants please refer to/n<https://sqlite.org/pragma.html#pragma_synchronous>.", "description": "Value for a `synchronous` pragma statement.\nFor a description of all variants please refer to\n<https://sqlite.org/pragma.html#pragma_synchronous>.",
"type": "string", "type": "string",
"enum": [ "enum": [
"EXTRA", "EXTRA",
@ -745,7 +745,7 @@ $ rad config schema
] ]
}, },
"Fetch": { "Fetch": {
"description": "Configuration for fetching repositories from/nother nodes.", "description": "Configuration for fetching repositories from\nother nodes.",
"type": "object", "type": "object",
"properties": { "properties": {
"signedReferences": { "signedReferences": {
@ -765,16 +765,16 @@ $ rad config schema
"type": "object", "type": "object",
"properties": { "properties": {
"minimum": { "minimum": {
"description": "The minimum feature level required to accept incoming/nreferences from other users. This value is compared/nagainst the feature level detected on refs as they are/nfetched./n/nNote that by increasing this value, security can be/ntraded for compatibility. The higher the value,/nthe less backward compatible, but the more secure, fetches will be.", "description": "The minimum feature level required to accept incoming\nreferences from other users. This value is compared\nagainst the feature level detected on refs as they are\nfetched.\n\nNote that by increasing this value, security can be\ntraded for compatibility. The higher the value,\nthe less backward compatible, but the more secure, fetches will be.",
"$ref": "#/$defs/FeatureLevel" "$ref": "#/$defs/FeatureLevel"
} }
} }
}, },
"FeatureLevel": { "FeatureLevel": {
"description": "The Signed References feature has evolved over time./nThis enum captures the corresponding /"feature level/"./n/nFeature levels are monotonic, in the sense that a greater feature level/nencompasses all the features of smaller ones.", "description": "The Signed References feature has evolved over time.\nThis enum captures the corresponding \"feature level\".\n\nFeature levels are monotonic, in the sense that a greater feature level\nencompasses all the features of smaller ones.",
"oneOf": [ "oneOf": [
{ {
"description": "The lowest feature level, with least security. It is vulnerable to/ngraft attacks and replay attacks.", "description": "The lowest feature level, with least security. It is vulnerable to\ngraft attacks and replay attacks.",
"type": "string", "type": "string",
"const": "none" "const": "none"
}, },

View File

@ -45,7 +45,7 @@ index 0000000..aae4e0e
+#include <stdio.h> +#include <stdio.h>
+ +
+int main(void) { +int main(void) {
+ printf("Hello World!/n"); + printf("Hello World!\n");
+ return 0; + return 0;
+} +}
``` ```
@ -61,8 +61,8 @@ index aae4e0e..a3ed869 100644
#include <stdio.h> #include <stdio.h>
int main(void) { int main(void) {
- printf("Hello World!/n"); - printf("Hello World!\n");
+ printf("Hello Radicle!/n"); + printf("Hello Radicle!\n");
return 0; return 0;
} }
``` ```
@ -79,8 +79,8 @@ index aae4e0e..a3ed869 100644
#include <stdio.h> #include <stdio.h>
int main(void) { int main(void) {
- printf("Hello World!/n"); - printf("Hello World!\n");
+ printf("Hello Radicle!/n"); + printf("Hello Radicle!\n");
return 0; return 0;
} }
``` ```
@ -97,7 +97,7 @@ index aae4e0e..0000000
-#include <stdio.h> -#include <stdio.h>
- -
-int main(void) { -int main(void) {
- printf("Hello World!/n"); - printf("Hello World!\n");
- return 0; - return 0;
-} -}
``` ```