Skip to content

Commit

Permalink
fixing a test by using an existing commodity
Browse files Browse the repository at this point in the history
  • Loading branch information
alensiljak committed Sep 7, 2023
1 parent c94304c commit bed8663
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/ext-parser-tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,10 @@ fn test_parsing_lots_per_unit() {

#[test]
fn test_parsing_lots_full_price() {
// arrange
let mut journal = Journal::new();

// act
parse_file("tests/trade-buy-sell-full-price.ledger", &mut journal);

// Assert
Expand All @@ -155,8 +157,9 @@ fn test_parsing_lots_full_price() {

// posts
assert_eq!(4, journal.all_posts().len());
let expected_cost = Amount::new(25.into(), Some(&Commodity::new("EUR")));
let xact = &journal.xacts[1];
let eur = journal.commodity_pool.find("EUR").unwrap() as *const Commodity;
let expected_cost = Amount::new(25.into(), Some(eur));
assert_eq!(expected_cost, xact.posts[0].cost.unwrap());
}

Expand Down

0 comments on commit bed8663

Please sign in to comment.