Skip to content

Commit

Permalink
fix broken test
Browse files Browse the repository at this point in the history
  • Loading branch information
shumbo committed Oct 31, 2024
1 parent bf3b5ba commit 35ed1bc
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions chorus_lib/examples/bookseller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand All @@ -28,7 +25,7 @@ struct Seller;
#[derive(ChoreographyLocation)]
struct Buyer;

struct BooksellerChoreography{
struct BooksellerChoreography {
title: Located<String, Buyer>,
budget: Located<i32, Buyer>,
}
Expand Down Expand Up @@ -90,13 +87,13 @@ fn main() {

let mut handles: Vec<thread::JoinHandle<()>> = 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),
});
Expand All @@ -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)
Expand All @@ -126,19 +123,19 @@ mod tests {

let mut handles: Vec<thread::JoinHandle<()>> = 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();
}
}
}

0 comments on commit 35ed1bc

Please sign in to comment.