Launcher: the command reference is the same on Windows
launcher.yml's Windows build has failed since the reference test landed: Git for Windows checks text out with CRLF (core.autocrlf), so docs/launcher-commands.md never equalled what markdown() generates. .gitattributes now pins LF for the generated files tests compare byte for byte, and the launcher's check reads the file whatever line endings a clone gave it, with a test of a CRLF checkout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
# Generated files that tests compare byte for byte with what they generate: LF on every OS, also
|
||||
# where Git for Windows' core.autocrlf would check them out with CRLF.
|
||||
docs/launcher-commands.md text eol=lf
|
||||
docs/horizon-ctl-commands.md text eol=lf
|
||||
website/src/tokens.css text eol=lf
|
||||
@@ -419,6 +419,20 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
/// Whether the reference on disk says `want`, whatever line endings the checkout gave it: Git
|
||||
/// for Windows checks text out with CRLF (core.autocrlf) where .gitattributes does not pin LF.
|
||||
fn up_to_date(have: &str, want: &str) -> bool {
|
||||
have.replace("\r\n", "\n") == want
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_windows_checkout_of_the_reference_is_up_to_date() {
|
||||
let want = markdown();
|
||||
assert!(up_to_date(&want, &want));
|
||||
assert!(up_to_date(&want.replace('\n', "\r\n"), &want));
|
||||
assert!(!up_to_date(&want.replacen("## ", "### ", 1), &want));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_launcher_reference_is_up_to_date() {
|
||||
let path =
|
||||
@@ -429,7 +443,7 @@ mod tests {
|
||||
}
|
||||
let have = std::fs::read_to_string(&path).unwrap_or_default();
|
||||
assert!(
|
||||
have == want,
|
||||
up_to_date(&have, &want),
|
||||
"docs/launcher-commands.md is out of date: HORIZON_WRITE_DOCS=1 cargo test --manifest-path launcher/Cargo.toml the_launcher_reference"
|
||||
);
|
||||
for tool in all() {
|
||||
|
||||
Reference in New Issue
Block a user