diff --git a/src/symbols.txt b/src/symbols.txt index ad28a54..2a98c1a 100644 --- a/src/symbols.txt +++ b/src/symbols.txt @@ -47,4 +47,5 @@ _rpmDigestFinal # Threse symbols are exposed by Rust :/ # See: https://gitlab.com/sequoia-pgp/rpm-sequoia/-/issues/3 -rust_eh_personality +?rust_eh_personality + diff --git a/tests/symbols.rs b/tests/symbols.rs index 640fa61..6a87e45 100644 --- a/tests/symbols.rs +++ b/tests/symbols.rs @@ -72,13 +72,22 @@ fn symbols() -> anyhow::Result<()> { if symbol.is_empty() { continue; } - expected_symbols.push(symbol); + if symbol.chars().nth(0) == Some('?') { + expected_symbols.push((&symbol[1..], true)); + } else { + expected_symbols.push((symbol, true)); + } } expected_symbols.sort(); eprintln!("Expected {} symbols:", expected_symbols.len()); - for symbol in expected_symbols.iter() { - eprintln!(" {}", symbol); + for (symbol, optional) in expected_symbols.iter() { + eprint!(" {}", symbol); + if *optional { + eprint!(" (optional)"); + } else { + eprint!(""); + } } let mut i = 0; @@ -91,13 +100,13 @@ fn symbols() -> anyhow::Result<()> { if i < symbols.len() && j < expected_symbols.len() - && symbols[i] == expected_symbols[j] + && symbols[i] == expected_symbols[j].0 { i += 1; j += 1; } else if (i < symbols.len() && j < expected_symbols.len() - && symbols[i] < expected_symbols[j]) + && symbols[i] < expected_symbols[j].0) || j == expected_symbols.len() { eprintln!("Found unexpected symbol {}", symbols[i]); @@ -105,12 +114,14 @@ fn symbols() -> anyhow::Result<()> { bad = true; } else if (i < symbols.len() && j < expected_symbols.len() - && symbols[i] > expected_symbols[j]) + && symbols[i] > expected_symbols[j].0) || i == symbols.len() { - eprintln!("Missing expected symbol {}", expected_symbols[j]); + if ! expected_symbols[j].1 { + eprintln!("Missing expected symbol {}", expected_symbols[j].0); + bad = true; + } j += 1; - bad = true; } else { unreachable!(); }