Skip to content

Commit

Permalink
Fix test, redundant remappings are not allowed anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
grandizzy committed Jan 22, 2025
1 parent b52687f commit a07a6ce
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions crates/config/src/providers/remappings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,8 @@ mod tests {

remappings.push(Remapping {
context: None,
name: "@openzeppelin/".to_string(),
path: "lib/openzeppelin/".to_string(),
name: "@openzeppelin-contracts/".to_string(),
path: "lib/openzeppelin-contracts/".to_string(),
});
remappings.push(Remapping {
context: None,
Expand All @@ -426,12 +426,13 @@ mod tests {
});

let result = remappings.into_inner();

assert_eq!(result.len(), 3, "Should have 3 remappings");
assert!(result.iter().any(
|r| r.name == "@openzeppelin/contracts/" && r.path == "lib/openzeppelin/contracts/"
));
assert!(result.iter().any(|r| r.name == "MyContract.sol" && r.path == "os/Contract.sol"));
assert_eq!(result.get(0).unwrap().name, "@openzeppelin-contracts/");
assert_eq!(result.get(0).unwrap().path, "lib/openzeppelin-contracts/");
assert_eq!(result.get(1).unwrap().name, "@openzeppelin/contracts/");
assert_eq!(result.get(1).unwrap().path, "lib/openzeppelin/contracts/");
assert_eq!(result.get(2).unwrap().name, "MyContract.sol");
assert_eq!(result.get(2).unwrap().path, "os/Contract.sol");
}

#[test]
Expand Down

0 comments on commit a07a6ce

Please sign in to comment.