Skip to content

Commit

Permalink
refactor: alter test
Browse files Browse the repository at this point in the history
  • Loading branch information
jpedroh committed Jun 15, 2024
1 parent ed6832f commit 9dc043b
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions matching/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,9 @@ pub fn calculate_matchings<'a>(

#[cfg(test)]
mod tests {
use crate::{calculate_matchings, matching_configuration::MatchingConfiguration};
use model::{cst_node::Terminal, CSTNode, Point};

use crate::{
calculate_matchings, matching_configuration::MatchingConfiguration, MatchingEntry,
};

#[test]
fn two_terminal_nodes_matches_with_a_score_of_one_if_they_have_the_same_kind_and_value() {
let left = CSTNode::Terminal(Terminal {
Expand All @@ -84,10 +81,9 @@ mod tests {
let matching_configuration = MatchingConfiguration::default();
let matchings = calculate_matchings(&left, &right, &matching_configuration);

assert_eq!(
Some(&MatchingEntry::new(&left, &right, 1)),
matchings.get_matching_entry(&left, &right)
)
let left_right_matching = matchings.get_matching_entry(&left, &right).unwrap();
assert_eq!(1, left_right_matching.score);
assert!(left_right_matching.is_perfect_match);
}

#[test]
Expand Down

0 comments on commit 9dc043b

Please sign in to comment.