Skip to content

Commit c78640c

Browse files
committed
Run web tests in both the cargo and wasm-pack test suites
1 parent 4dbeb75 commit c78640c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

sim/tests/web.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@ use wasm_bindgen_test::*;
88

99
wasm_bindgen_test_configure!(run_in_browser);
1010

11-
fn epsilon() -> f64 {
12-
0.34
13-
}
14-
11+
#[test]
1512
#[wasm_bindgen_test]
1613
fn processor_from_queue_response_time_is_correct() {
1714
let models = r#"
@@ -215,11 +212,11 @@ fn processor_from_queue_response_time_is_correct() {
215212
.sum::<f64>()
216213
/ 50.0;
217214
let expectation = 1.0 / 3.0; // Exponential with lambda=3.0
218-
assert!(
219-
(average_batch_completion_time - 2.0 * expectation).abs() / (2.0 * expectation) < epsilon()
220-
);
215+
// Epsilon of 0.34
216+
assert!((average_batch_completion_time - 2.0 * expectation).abs() / (2.0 * expectation) < 0.34);
221217
}
222218

219+
#[test]
223220
#[wasm_bindgen_test]
224221
fn processor_network_no_job_loss() {
225222
let models = r#"
@@ -419,6 +416,7 @@ fn processor_network_no_job_loss() {
419416
assert_eq!(storage_arrivals_count, expected);
420417
}
421418

419+
#[test]
422420
#[wasm_bindgen_test]
423421
fn simulation_serialization_deserialization_field_ordering() {
424422
// Confirm field order does not matter for yaml deserialization
@@ -464,6 +462,7 @@ fn simulation_serialization_deserialization_field_ordering() {
464462
WebSimulation::post_yaml(models, connectors);
465463
}
466464

465+
#[test]
467466
#[wasm_bindgen_test]
468467
fn simulation_serialization_deserialization_round_trip() {
469468
// Confirm a round trip deserialization-serialization
@@ -514,6 +513,7 @@ fn simulation_serialization_deserialization_round_trip() {
514513
);
515514
}
516515

516+
#[test]
517517
#[wasm_bindgen_test]
518518
fn ci_half_width_for_average_waiting_time() {
519519
let models = r#"

0 commit comments

Comments
 (0)