From 35ed1bc3536ceb9fc79cb9a559ad0cbbc57a6f2b Mon Sep 17 00:00:00 2001 From: Shun Kashiwa Date: Thu, 31 Oct 2024 10:26:19 -0700 Subject: [PATCH] fix broken test --- chorus_lib/examples/bookseller.rs | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/chorus_lib/examples/bookseller.rs b/chorus_lib/examples/bookseller.rs index e2c89f1..8eefa4b 100644 --- a/chorus_lib/examples/bookseller.rs +++ b/chorus_lib/examples/bookseller.rs @@ -3,10 +3,7 @@ extern crate chorus_lib; use std::io; use std::thread; -use chorus_lib::{ - core::{Located}, - transport::local::{LocalTransportChannelBuilder}, -}; +use chorus_lib::{core::Located, transport::local::LocalTransportChannelBuilder}; use chrono::NaiveDate; use chorus_lib::core::{ChoreoOp, Choreography, ChoreographyLocation, LocationSet, Projector}; @@ -28,7 +25,7 @@ struct Seller; #[derive(ChoreographyLocation)] struct Buyer; -struct BooksellerChoreography{ +struct BooksellerChoreography { title: Located, budget: Located, } @@ -90,13 +87,13 @@ fn main() { let mut handles: Vec> = Vec::new(); handles.push(thread::spawn(move || { - seller_projector.epp_and_run(BooksellerChoreography{ + seller_projector.epp_and_run(BooksellerChoreography { title: seller_projector.remote(Buyer), budget: seller_projector.remote(Buyer), }); })); handles.push(thread::spawn(move || { - buyer_projector.epp_and_run(BooksellerChoreography{ + buyer_projector.epp_and_run(BooksellerChoreography { title: buyer_projector.local(title), budget: buyer_projector.local(BUDGET), }); @@ -112,7 +109,7 @@ mod tests { #[test] fn distributed_tapl() { - let title = String::new("TAPL"); + let title = String::from("TAPL"); let transport_channel = LocalTransportChannelBuilder::new() .with(Seller) @@ -126,19 +123,19 @@ mod tests { let mut handles: Vec> = Vec::new(); handles.push(thread::spawn(move || { - seller_projector.epp_and_run(BooksellerChoreography{ + seller_projector.epp_and_run(BooksellerChoreography { title: seller_projector.remote(Buyer), budget: seller_projector.remote(Buyer), }); })); handles.push(thread::spawn(move || { - buyer_projector.epp_and_run(BooksellerChoreography{ + buyer_projector.epp_and_run(BooksellerChoreography { title: buyer_projector.local(title), budget: buyer_projector.local(BUDGET), }); })); for h in handles { - assert!(h.join().unwrap()); + h.join().unwrap(); } } }