From 0f3d7cfba525220924b97ea59a80d2f32fba381c Mon Sep 17 00:00:00 2001 From: Alex Todoran Date: Sun, 23 Feb 2025 12:44:15 +0100 Subject: [PATCH] add failing multiline comment --- src/main.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/main.rs b/src/main.rs index ca7a45f..c44861a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -441,6 +441,34 @@ mod tests { ); } + #[test] + fn ignore_multiline_comment() { + _ = env_logger::try_init(); + const LINKER_SCRIPT: &str = "MEMORY + { + FLASH : ORIGIN = 0x00000000, LENGTH = 256K + /* This is a multiline comment + RAM : ORIGIN = 0x20000000, LENGTH = 64K */ + RAM : ORIGIN = 0x20000000, LENGTH = 64K + } + + INCLUDE device.x"; + + assert_eq!( + find_ram_in_linker_script(LINKER_SCRIPT), + Some(MemoryEntry { + line: 4, + origin: 0x20000000, + length: 64 * 1024, + }) + ); + + assert_eq!( + get_includes_from_linker_script(LINKER_SCRIPT), + vec!["device.x"] + ); + } + #[test] fn test_perform_addition_hex_and_number() { _ = env_logger::try_init();