an http based roguelike rpg about jelqing
Blame: src/tests/rolls.rs
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 1 | use super::*; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 2 | |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 3 | #[tokio::test] |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 4 | async fn holding_calms_and_sometimes_reflects() { |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 5 | let mut calmed = 0; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 6 | let mut reflected = 0; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 7 | let mut ruptured = 0; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 8 | for seed in 0..600u64 { |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 9 | let mut run = Run::new("cafebabe".into(), "cafe".into(), seed); |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 10 | run.body.eq = 75; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 11 | match run.hold() { |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 12 | Ok(_) if run.body.eq == 0 => reflected += 1, |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 13 | Ok(_) => calmed += 1, |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 14 | Err(_) => ruptured += 1, |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 15 | } |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 16 | } |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 17 | assert!( |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 18 | (25..=80).contains(&reflected), |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 19 | "one HOLD in twelve should reflect, about 50 of 600, got {reflected} and {calmed} calm" |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 20 | ); |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 21 | assert!( |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 22 | ruptured <= 7, |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 23 | "the flat 1 in 250 ruptured {ruptured} of 600 holds, about 2.4 expected" |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 24 | ); |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 25 | } |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 26 | |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 27 | #[tokio::test] |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 28 | async fn the_burn_shifts_the_rupture_tiers() { |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 29 | async fn ruptures(burned: bool) -> u32 { |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 30 | let mut gone = 0; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 31 | for seed in 0..400u64 { |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 32 | let app = app_with(Floor::Bedroom, seed, |run| { |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 33 | run.body.warmed_up = true; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 34 | run.body.eq = 60; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 35 | run.items.lubes.baby_oil = 9; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 36 | run.body.conditions.friction_burn = burned; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 37 | }); |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 38 | let lube = [("content-type", "application/baby-oil")]; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 39 | let jelq = send( |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 40 | &app, |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 41 | "JELQ", |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 42 | "/runs/cafebabe?technique=wet&intensity=5", |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 43 | &lube, |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 44 | "", |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 45 | ) |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 46 | .await; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 47 | if jelq.status() == StatusCode::INTERNAL_SERVER_ERROR { |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 48 | gone += 1; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 49 | } |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 50 | } |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 51 | gone |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 52 | } |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 53 | let burned = ruptures(true).await; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 54 | let calm = ruptures(false).await; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 55 | assert!( |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 56 | burned >= 8 && calm <= 4, |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 57 | "burned {burned} ruptures against {calm}" |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 58 | ); |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 59 | } |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 60 | |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 61 | #[tokio::test] |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 62 | async fn the_top_tier_rolls_a_single_third() { |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 63 | let mut ruptures = 0; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 64 | let mut early = 0; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 65 | for seed in 0..400u64 { |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 66 | let app = app_with(Floor::Bedroom, seed, |run| { |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 67 | run.body.warmed_up = true; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 68 | run.body.eq = 96; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 69 | run.items.lubes.baby_oil = 9; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 70 | run.items.kit.blinds = true; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 71 | }); |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 72 | let lube = [("content-type", "application/baby-oil")]; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 73 | let jelq = send( |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 74 | &app, |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 75 | "JELQ", |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 76 | "/runs/cafebabe?technique=wet&intensity=5", |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 77 | &lube, |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 78 | "", |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 79 | ) |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 80 | .await; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 81 | match jelq.status() { |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 82 | StatusCode::INTERNAL_SERVER_ERROR => ruptures += 1, |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 83 | StatusCode::TOO_EARLY => early += 1, |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 84 | other => panic!("seed {seed} ended in {other}"), |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 85 | } |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 86 | } |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 87 | assert!( |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 88 | (90..=175).contains(&ruptures), |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 89 | "ruptures {ruptures} of 400 against {early} early" |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 90 | ); |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 91 | assert!( |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 92 | (225..=310).contains(&early), |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 93 | "early {early} of 400 against {ruptures} ruptures" |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 94 | ); |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 95 | } |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 96 | |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 97 | #[tokio::test] |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 98 | async fn holding_rolls_a_flat_rupture_chance() { |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 99 | async fn ruptures(eq: i32, stamina: i32) -> u32 { |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 100 | let mut gone = 0; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 101 | for seed in 0..600u64 { |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 102 | let app = app_with(Floor::Bedroom, seed, |run| { |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 103 | run.body.warmed_up = true; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 104 | run.body.eq = eq; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 105 | run.body.stamina = stamina; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 106 | }); |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 107 | let held = send(&app, "HOLD", "/runs/cafebabe", &[], "").await; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 108 | if held.status() == StatusCode::INTERNAL_SERVER_ERROR { |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 109 | gone += 1; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 110 | } |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 111 | } |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 112 | gone |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 113 | } |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 114 | let high = ruptures(90, 10).await; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 115 | let low = ruptures(30, 2).await; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 116 | assert!((0..=7).contains(&high), "high holds ruptured {high}/600"); |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 117 | assert!((0..=7).contains(&low), "low holds ruptured {low}/600"); |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 118 | } |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 119 | |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 120 | #[tokio::test] |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 121 | async fn the_kitchen_pays_out_at_the_documented_odds() { |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 122 | let mut oil = 0; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 123 | let mut drinks = 0; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 124 | let mut packs = 0; |
f16ab17c8ff6 | atagen | 2026-10-13 11:14 UTC | 125 | let mut raids = 0; |
f16ab17c8ff6 | atagen | 2026-10-13 11:14 UTC | 126 | for seed in 0..800u64 { |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 127 | let mut run = Run::new("cafebabe".into(), "cafe".into(), seed); |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 128 | let held = ( |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 129 | run.items.lubes.coconut_oil, |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 130 | run.items.stores.energy_drinks, |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 131 | run.items.stores.ice_packs, |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 132 | ); |
f16ab17c8ff6 | atagen | 2026-10-13 11:14 UTC | 133 | if run.raid_kitchen().is_err() { |
f16ab17c8ff6 | atagen | 2026-10-13 11:14 UTC | 134 | continue; |
f16ab17c8ff6 | atagen | 2026-10-13 11:14 UTC | 135 | } |
f16ab17c8ff6 | atagen | 2026-10-13 11:14 UTC | 136 | raids += 1; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 137 | oil += u32::from(run.items.lubes.coconut_oil > held.0); |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 138 | drinks += u32::from(run.items.stores.energy_drinks > held.1); |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 139 | packs += u32::from(run.items.stores.ice_packs > held.2); |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 140 | } |
f16ab17c8ff6 | atagen | 2026-10-13 11:14 UTC | 141 | let rate = |found: u32| f64::from(found) / f64::from(raids); |
f16ab17c8ff6 | atagen | 2026-10-13 11:14 UTC | 142 | assert!( |
f16ab17c8ff6 | atagen | 2026-10-13 11:14 UTC | 143 | (0.28..=0.39).contains(&rate(oil)), |
f16ab17c8ff6 | atagen | 2026-10-13 11:14 UTC | 144 | "coconut {oil} in {raids}" |
f16ab17c8ff6 | atagen | 2026-10-13 11:14 UTC | 145 | ); |
f16ab17c8ff6 | atagen | 2026-10-13 11:14 UTC | 146 | assert!( |
f16ab17c8ff6 | atagen | 2026-10-13 11:14 UTC | 147 | (0.15..=0.25).contains(&rate(drinks)), |
f16ab17c8ff6 | atagen | 2026-10-13 11:14 UTC | 148 | "energy {drinks} in {raids}" |
f16ab17c8ff6 | atagen | 2026-10-13 11:14 UTC | 149 | ); |
f16ab17c8ff6 | atagen | 2026-10-13 11:14 UTC | 150 | assert!( |
f16ab17c8ff6 | atagen | 2026-10-13 11:14 UTC | 151 | (0.08..=0.17).contains(&rate(packs)), |
f16ab17c8ff6 | atagen | 2026-10-13 11:14 UTC | 152 | "ice {packs} in {raids}" |
f16ab17c8ff6 | atagen | 2026-10-13 11:14 UTC | 153 | ); |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 154 | } |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 155 | |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 156 | #[tokio::test] |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 157 | async fn the_kitchen_rolls_the_normal_tiers() { |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 158 | async fn ruptures(eq: i32) -> u32 { |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 159 | let mut gone = 0; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 160 | for seed in 0..600u64 { |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 161 | let app = app_with(Floor::Bedroom, seed, |run| run.body.eq = eq); |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 162 | let raid = send(&app, "POST", "/runs/cafebabe/kitchen", &[], "").await; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 163 | if raid.status() == StatusCode::INTERNAL_SERVER_ERROR { |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 164 | gone += 1; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 165 | } |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 166 | } |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 167 | gone |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 168 | } |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 169 | let hot = ruptures(96).await; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 170 | let cool = ruptures(40).await; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 171 | assert!((40..=80).contains(&hot), "hot kitchen ruptured {hot}/600"); |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 172 | assert!((0..=9).contains(&cool), "cool kitchen ruptured {cool}/600"); |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 173 | } |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 174 | |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 175 | #[tokio::test] |
4b1f5f88827d | atagen | 2026-10-13 10:18 UTC | 176 | async fn degloving_takes_one_hard_dry_stroke_in_twenty() { |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 177 | let mut degloved = 0; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 178 | for seed in 0..1200u64 { |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 179 | let app = app_with(Floor::Hotel, seed, |run| { |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 180 | run.here.wifi_accepted = true; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 181 | run.body.warmed_up = true; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 182 | run.body.eq = 55; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 183 | run.body.foreskin = Some(1.0); |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 184 | }); |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 185 | let dry = send( |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 186 | &app, |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 187 | "JELQ", |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 188 | "/runs/cafebabe?technique=dry&intensity=8", |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 189 | &[], |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 190 | "", |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 191 | ) |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 192 | .await; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 193 | if dry.status() == StatusCode::GONE |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 194 | && json(dry).await["type"] |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 195 | .as_str() |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 196 | .unwrap() |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 197 | .ends_with("degloved") |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 198 | { |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 199 | degloved += 1; |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 200 | } |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 201 | } |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 202 | assert!( |
4b1f5f88827d | atagen | 2026-10-13 10:18 UTC | 203 | (35..=90).contains(°loved), |
4b1f5f88827d | atagen | 2026-10-13 10:18 UTC | 204 | "{degloved} degloved in 1200 hard dry strokes, about 60 expected" |
4b1f5f88827d | atagen | 2026-10-13 10:18 UTC | 205 | ); |
4b1f5f88827d | atagen | 2026-10-13 10:18 UTC | 206 | } |
4b1f5f88827d | atagen | 2026-10-13 10:18 UTC | 207 | |
4b1f5f88827d | atagen | 2026-10-13 10:18 UTC | 208 | #[tokio::test] |
4b1f5f88827d | atagen | 2026-10-13 10:18 UTC | 209 | async fn degloving_takes_one_cold_stroke_in_twenty() { |
4b1f5f88827d | atagen | 2026-10-13 10:18 UTC | 210 | let mut degloved = 0; |
4b1f5f88827d | atagen | 2026-10-13 10:18 UTC | 211 | for seed in 0..1200u64 { |
4b1f5f88827d | atagen | 2026-10-13 10:18 UTC | 212 | let app = app_with(Floor::Hotel, seed, |run| { |
4b1f5f88827d | atagen | 2026-10-13 10:18 UTC | 213 | run.here.wifi_accepted = true; |
4b1f5f88827d | atagen | 2026-10-13 10:18 UTC | 214 | run.body.eq = 55; |
4b1f5f88827d | atagen | 2026-10-13 10:18 UTC | 215 | run.body.foreskin = Some(1.0); |
4b1f5f88827d | atagen | 2026-10-13 10:18 UTC | 216 | }); |
4b1f5f88827d | atagen | 2026-10-13 10:18 UTC | 217 | let cold = send(&app, "JELQ", "/runs/cafebabe?technique=stretch", &[], "").await; |
97c05b741d8f | atagen | 2026-10-13 11:27 UTC | 218 | if cold.status() != StatusCode::GONE { |
97c05b741d8f | atagen | 2026-10-13 11:27 UTC | 219 | continue; |
97c05b741d8f | atagen | 2026-10-13 11:27 UTC | 220 | } |
97c05b741d8f | atagen | 2026-10-13 11:27 UTC | 221 | let bare = header(&cold, "x-foreskin") == "gone"; |
97c05b741d8f | atagen | 2026-10-13 11:27 UTC | 222 | let problem = json(cold).await; |
97c05b741d8f | atagen | 2026-10-13 11:27 UTC | 223 | if problem["type"].as_str().unwrap().ends_with("degloved") { |
97c05b741d8f | atagen | 2026-10-13 11:27 UTC | 224 | assert!(bare, "degloving takes the foreskin with it"); |
97c05b741d8f | atagen | 2026-10-13 11:27 UTC | 225 | assert_eq!(problem["foreskin"], -1.0); |
4b1f5f88827d | atagen | 2026-10-13 10:18 UTC | 226 | degloved += 1; |
4b1f5f88827d | atagen | 2026-10-13 10:18 UTC | 227 | } |
4b1f5f88827d | atagen | 2026-10-13 10:18 UTC | 228 | } |
4b1f5f88827d | atagen | 2026-10-13 10:18 UTC | 229 | assert!( |
4b1f5f88827d | atagen | 2026-10-13 10:18 UTC | 230 | (35..=90).contains(°loved), |
4b1f5f88827d | atagen | 2026-10-13 10:18 UTC | 231 | "{degloved} degloved in 1200 cold strokes, about 60 expected" |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 232 | ); |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 233 | } |