Skip to content

Commit

Permalink
fix: unit test for expression
Browse files Browse the repository at this point in the history
  • Loading branch information
madonuko committed Jun 12, 2024
1 parent 0c442c8 commit 9bddd56
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
# rpmspec-rs

A pure Rust library for parsing RPM spec files.

# System Build Dependencies

- `luajit-devel`
1 change: 1 addition & 0 deletions rpmspec-common/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@ pub mod textproc {
use smartstring::alias::String;
use tracing::warn;

#[deprecated = "Incorrect impl; use Consumer.skip_til_endbrace() instead."]
pub fn chk_ps(quotes: &mut String, ch: char) -> Result<()> {
if ch == '\'' {
if quotes.ends_with('\'') {
Expand Down
2 changes: 1 addition & 1 deletion src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2438,7 +2438,7 @@ mod tests {
fn expression() {
let mut p = super::SpecParser::new();
let out = &mut String::new();
p.macros.insert("hai".into(), vec![MacroType::Runtime { s: Arc::new(RwLock::new("0".into())), file: Arc::from(Path::new("<?>")), offset: 0, param: true, len: 1 }]);
p.macros.insert("hai".into(), vec![MacroType::Runtime { s: Arc::new(RwLock::new("0".into())), file: Arc::from(Path::new("<?>")), offset: 0, param: false, len: 1 }]);
p.parse_macro::<RR>(out, &mut "%[1 + 2 * (3+4) - %hai]".into()).unwrap();
assert_eq!(out, "15");
out.clear();
Expand Down

0 comments on commit 9bddd56

Please sign in to comment.