Skip to content

Commit

Permalink
add failing multiline comment
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-tdrn committed Feb 23, 2025
1 parent fe8f78f commit 0f3d7cf
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 0f3d7cf

Please sign in to comment.