So we get stack traces.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
}
}
- #[throws(AE)]
+ #[throws(Explode)]
pub fn parse_html(resp: reqwest::blocking::Response) -> Html {
assert_eq!(resp.status(), 200);
let body = resp.text()?;
#[ext(pub, name=RequestBuilderExt)]
impl reqwest::blocking::RequestBuilder {
- #[throws(AE)]
+ #[throws(Explode)]
fn send(self) -> reqwest::blocking::Response { self.send()? }
- #[throws(AE)]
+ #[throws(Explode)]
fn send_parse_html(self) -> Html {
let resp = self.send()?;
parse_html(resp)?
type Update = JsV;
-#[throws(AE)]
+#[throws(Explode)]
fn updates_parser<R:Read>(input: R, out: &mut mpsc::Sender<Update>) {
let mut accum: HashMap<String, String> = default();
for l in BufReader::new(input).lines() {
}
impl Ctx {
- #[throws(AE)]
+ #[throws(Explode)]
fn connect_player<'su>(&self, player: &Player) -> Session {
let client = reqwest::blocking::Client::new();
let loading = client.get(&player.url).send_parse_html()?;
}
pub fn chdir_root<F>(&mut self, f: F)
- where F: FnOnce(&mut Self) -> Result<(),AE>
+ where F: FnOnce(&mut Self) -> Result<(),Explode>
{
let tmp = self.su().ds.abstmp.clone();
env::set_current_dir("/").expect("cd /");
}
impl Session {
- #[throws(AE)]
+ #[throws(Explode)]
fn pieces<PI:Idx>(&self) -> Pieces<PI> {
let pieces = self.dom
.element("#pieces_marker")
pieces
}
- #[throws(AE)]
+ #[throws(Explode)]
fn api_piece_op_single<O:PieceOp>(&mut self, piece: &str, o: O) {
let (opname, payload) = if let Some(o) = o.api() { o } else { return };
assert_eq!(resp.status(), 200);
}
- #[throws(AE)]
+ #[throws(Explode)]
fn api_piece<P:PieceSpecForOp, O:PieceOp>(
&mut self, g: GrabHow, mut p: P, o: O
) {
}
}
- #[throws(AE)]
+ #[throws(Explode)]
fn await_update<
R,
F: FnMut(&mut Session, Generation, &str, &JsV) -> Option<R>,
}
}
- #[throws(AE)]
+ #[throws(Explode)]
fn synchx<
PI: Idx,
F: FnMut(&mut Session, Generation, &str, &JsV),
)?;
}
- #[throws(AE)]
+ #[throws(Explode)]
fn synchu<PI:Idx>(&mut self, pieces: &mut Pieces<PI>) {
self.synchx(Some(pieces), None, |_session, _gen, _k, _v| ())?;
}
- #[throws(AE)]
+ #[throws(Explode)]
fn synch(&mut self) {
self.synchx::<PIA,_>(None, None, |_session, _gen, _k, _v|())?;
}
self.su().ds.otter_prctx(&self.prctx, &args)?
}
- #[throws(AE)]
+ #[throws(Explode)]
fn library_load(&mut self) {
prepare_game(&self.su().ds, &self.prctx, TABLE)?;
assert_eq!(added.len(), 6);
}
- #[throws(AE)]
+ #[throws(Explode)]
fn hidden_hand(&mut self) {
prepare_game(&self.su().ds, &default(), TABLE)?;
let mut alice = self.connect_player(&self.alice)?;
self.otter(&command)?;
}
- #[throws(AE)]
+ #[throws(Explode)]
fn specs(&mut self) {
struct Specs {
def: String,
}
}
-#[throws(AE)]
+#[throws(Explode)]
fn tests(mut c: Ctx) {
test!(c, "library-load", c.chdir_root(|c| c.library_load() ));
test!(c, "hidden-hand", c.hidden_hand() ?);
test!(c, "bundles", c.bundles() ?);
}
-#[throws(AE)]
+#[throws(Explode)]
fn main() {
{
let (opts, _cln, _instance, su) = setup_core(
}
}
-#[throws(AE)]
-pub fn as_usual<F: FnOnce(UsualSetup) -> Result<(), AE>>(
+#[throws(Explode)]
+pub fn as_usual<F: FnOnce(UsualSetup) -> Result<(), Explode>>(
f: F, exe_module_path: &str,
) {
let usual = UsualSetup::new(exe_module_path)?;
pub struct PortmanteauMember {
path: &'static str,
- f: fn() -> Result<(), AE>,
+ f: fn() -> Result<(), Explode>,
}
inventory::collect!(PortmanteauMember);
usual_wanted_tests!{Ctx, su}
impl Ctx {
- #[throws(AE)]
+ #[throws(Explode)]
fn check_link(&mut self, desc: &'static str, url: Option<&str>) {
(||{
let mut w = self.su.w(&self.alice)?;
.context(desc).did("check link")?
}
- #[throws(AE)]
+ #[throws(Explode)]
fn otter(&mut self, verb: &[&str], args: &[&str]) {
self.su.w(&self.alice)?.otter(verb, args)?
}
- #[throws(AE)]
+ #[throws(Explode)]
fn test_link(&mut self, kind: LinkKind, desc: &'static str, url: &str) {
(||{
self.otter(&["set-link"], &[&kind.to_string(), url])?;
.context(desc).did("test link")?
}
- #[throws(AE)]
+ #[throws(Explode)]
fn test_remove_link(&mut self, kind: LinkKind, desc: &'static str) {
(||{
self.otter(&["set-link"], &[&kind.to_string(), ""])?;
}
}
-#[throws(AE)]
+#[throws(Explode)]
fn tests(UsualSetup { su, alice, ..}: UsualSetup) {
let mut c = Ctx { su, alice };
debug!("finishing");
}
-#[throws(AE)]
-pub fn main() { as_usual(tests, module_path!())? }
+#[throws(Explode)]
+pub fn main() { as_usual(tests, module_path!())?; }
}
}
-#[throws(AE)]
+#[throws(Explode)]
fn tests(UsualSetup { su, alice, ..}: UsualSetup) {
let mut c = Ctx { su, alice };
debug!("finishing");
}
-#[throws(AE)]
+#[throws(Explode)]
pub fn main() { as_usual(tests, module_path!())?; }
const PAWN2: &str = "8v1";
const ALICE: &str = "1#1";
-#[throws(AE)]
+#[throws(Explode)]
pub fn player_dasharray(player: &'static str) -> String {
let player: PlayerId = player.try_into().context(player)?;
let player: slotmap::KeyData = player.into();
}
impl Ctx {
- #[throws(AE)]
+ #[throws(Explode)]
fn claim(&mut self){
let su = &mut self.su;
}
}
- #[throws(AE)]
+ #[throws(Explode)]
fn ungrab_race(&mut self){
let su = &mut self.su;
chk_alice_on_top(&self.bob ).did("chk bob" )?;
}
- #[throws(AE)]
+ #[throws(Explode)]
fn regrab_race(&mut self){
let su = &mut self.su;
const MIDHAND: Pos = PosC::new(40, 40);
}
}
-#[throws(AE)]
+#[throws(Explode)]
fn tests(UsualSetup { su, alice, bob, ..}: UsualSetup) {
let mut c = Ctx { su, alice, bob };
debug!("finishing");
}
-#[throws(AE)]
+#[throws(Explode)]
pub fn main() { as_usual(tests, module_path!())? }
usual_wanted_tests!{Ctx, su}
impl Ctx {
- #[throws(AE)]
+ #[throws(Explode)]
fn drag(&mut self){
let su = &mut self.su;
}
}
- #[throws(AE)]
+ #[throws(Explode)]
fn rotate(&mut self) -> &'static str {
let pc = "4v1";
let su = &mut self.su;
pc
}
- #[throws(AE)]
+ #[throws(Explode)]
fn drag_off(&mut self, pc: &'static str) {
let su = &mut self.su;
pc
}
- #[throws(AE)]
+ #[throws(Explode)]
fn unselect(&mut self, pc: &'static str) {
let su = &mut self.su;
}
}
- #[throws(AE)]
+ #[throws(Explode)]
fn conflict(&mut self) {
let pc = "1v1";
let su = &mut self.su;
}
}
-#[throws(AE)]
+#[throws(Explode)]
fn tests(UsualSetup { su, alice, bob, spec, ..}: UsualSetup) {
let mut c = Ctx { su, alice, bob, spec };
debug!("finishing");
}
-#[throws(AE)]
+#[throws(Explode)]
pub fn main() { as_usual(tests, module_path!())? }