Skip to content

Commit

Permalink
Merge pull request lf-lang#186 from lf-lang/ts-level-assignment
Browse files Browse the repository at this point in the history
`NetworkSender` and `NetworkSender` classes for new federated execution scheme
  • Loading branch information
byeonggiljun authored Jul 28, 2023
2 parents 14f5b13 + eb9ddfb commit 6b55c29
Show file tree
Hide file tree
Showing 6 changed files with 257 additions and 151 deletions.
6 changes: 6 additions & 0 deletions __tests__/hierarchy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ describe("Container to Contained", () => {
expect(
app.container.canConnect(app.container.contained.a, app.container.a)
).toBe(false);
expect(
app.container.canConnect(
app.container.a,
app.container.b
)
).toBe(true);
expect(
app.container.canConnect(
app.container.contained.a,
Expand Down
13 changes: 13 additions & 0 deletions __tests__/time.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,19 @@ describe("time helper functions", function () {
);
});

/**
* Test if addition works correctly.
*/
describe("add time value", function () {
expect(TimeValue.forever().add(TimeValue.forever())).toEqual(TimeValue.forever());
expect(TimeValue.forever().add(TimeValue.never())).toEqual(TimeValue.zero());
expect(TimeValue.forever().add(TimeValue.sec(1))).toEqual(TimeValue.forever());
expect(TimeValue.never().add(TimeValue.never())).toEqual(TimeValue.never());
expect(TimeValue.never().add(TimeValue.forever())).toEqual(TimeValue.zero());
expect(TimeValue.never().add(TimeValue.sec(1))).toEqual(TimeValue.never());
});


/**
* Test conversion to string
*/
Expand Down
2 changes: 1 addition & 1 deletion src/core/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class Action<T> extends ScheduledTrigger<T> implements Read<T> {

schedule(extraDelay: 0 | TimeValue, value: T, intendedTag?: Tag): void {
if (!(extraDelay instanceof TimeValue)) {
extraDelay = TimeValue.secs(0);
extraDelay = TimeValue.zero();
}

let tag = this.action.runtime.util.getCurrentTag();
Expand Down
Loading

0 comments on commit 6b55c29

Please sign in to comment.