From 53cab9600f903cb434dc8af566578f05d37dc92a Mon Sep 17 00:00:00 2001 From: WillLillis Date: Thu, 26 Dec 2024 01:20:40 -0500 Subject: [PATCH] chore(test): only remove \r line endings on Windows platforms --- asm-lsp/test.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/asm-lsp/test.rs b/asm-lsp/test.rs index 56901f30..b8a0b43a 100644 --- a/asm-lsp/test.rs +++ b/asm-lsp/test.rs @@ -2419,9 +2419,11 @@ Width: 8 bits", let mut raw_vec = populate_registers(regs_raw).unwrap(); // HACK: Windows line endings... - for reg in &mut raw_vec { - if let Some(descr) = ®.description { - reg.description = Some(descr.replace('\r', "")); + if cfg!(target_os = "windows") { + for reg in &mut raw_vec { + if let Some(descr) = ®.description { + reg.description = Some(descr.replace('\r', "")); + } } } @@ -2644,8 +2646,10 @@ Width: 8 bits", let mut raw_vec = $populate_fn(dirs_raw).unwrap(); // HACK: Windows line endings... - for dir in &mut raw_vec { - dir.description = dir.description.replace('\r', ""); + if cfg!(target_os = "windows") { + for dir in &mut raw_vec { + dir.description = dir.description.replace('\r', ""); + } } for dir in ser_vec {