Skip to content

Commit

Permalink
tests: test defines hash table
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Desmottes authored and gdesmott committed Feb 10, 2021
1 parent 7d1eb15 commit 5e2a6fb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ fn good() {
let (libraries, flags) = toml("toml-good", vec![]).unwrap();
let testlib = libraries.get_by_name("testlib").unwrap();
assert_eq!(testlib.version, "1.2.3");
assert_eq!(
testlib.defines.get("BADGER").unwrap().as_deref(),
Some("yes")
);
assert!(testlib.defines.get("AWESOME").unwrap().is_none());

let testdata = libraries.get_by_name("testdata").unwrap();
assert_eq!(testdata.version, "4.5.6");
assert!(libraries.get_by_name("testmore").is_none());
Expand Down
2 changes: 1 addition & 1 deletion src/tests/testlib.pc
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ Name: Test Library
Description: A fake library to test pkg-config.
Version: 1.2.3
Libs: -L${libdir} -ltest -F${libdir} -framework someframework
Cflags: -I${includedir}
Cflags: -I${includedir} -DBADGER=yes -DAWESOME

0 comments on commit 5e2a6fb

Please sign in to comment.