Skip to content

Commit

Permalink
#75 cleaner
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Jan 12, 2023
1 parent f0f3c6c commit 6c0f77d
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/find.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,8 @@ struct FakeRelay {

#[cfg(test)]
impl FakeRelay {
pub fn new() -> FakeRelay {
let mut g = Sodg::empty();
g.add(0).unwrap();
g.add(1).unwrap();
g.bind(0, 1, "foo").unwrap();
let r = FakeRelay { g };
r
pub fn new(g: Sodg) -> FakeRelay {
FakeRelay { g }
}
pub fn find(&mut self, _k: &str) -> Result<u32> {
// self.g.find(0, k, self)
Expand All @@ -235,7 +230,11 @@ impl Relay for FakeRelay {
#[test]
#[ignore]
fn relay_modifies_sodg_back() -> Result<()> {
let mut relay = FakeRelay::new();
let mut g = Sodg::empty();
g.add(0).unwrap();
g.add(1).unwrap();
g.bind(0, 1, "foo").unwrap();
let mut relay = FakeRelay::new(g);
assert_eq!(1, relay.find("bar")?);
Ok(())
}

0 comments on commit 6c0f77d

Please sign in to comment.