Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

9
LINES

< > BotCompany Repo | #1008188 // assertFail_verbose - assert that a code fragment throws an exception (throwable)

JavaX fragment (include)

1  
static void assertFail_verbose(Runnable r) {
2  
  try {
3  
    r.run();
4  
  } catch e {
5  
    print("OK: " + getInnerMessage(silentException(e)));
6  
    ret;
7  
  }
8  
  fail("No exception thrown!");
9  
}

Author comment

Began life as a copy of #1005129

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1008188
Snippet name: assertFail_verbose - assert that a code fragment throws an exception (throwable)
Eternal ID of this version: #1008188/5
Text MD5: ac38419125ab58deffcbabb7224fede0
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-04-29 19:41:56
Source code size: 191 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 469 / 490
Version history: 4 change(s)
Referenced in: [show references]