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

25
LINES

< > BotCompany Repo | #1018446 // assertEqualsVerbose_struct - print structs

JavaX fragment (include)

static <A> A assertEqualsVerbose_struct(O x, A y) {
  assertEqualsVerbose_struct((S) null, x, y);
  ret y;
}

static <A> A assertEqualsVerbose_struct(S msg, O x, A y) {
  if (!eq(x, y)) {
    fail((msg != null ? msg + ": " : "") + "expected " + sfu(y) + ", got " + sfu(x));
  } else
    print("OK: " + sfu(x));
  ret y;
}


ifclass Scorer
static void assertEqualsVerbose_struct(Scorer scorer, O x, O y) {
  if (!eq(x, y)) {
    print(sfu(y) + " != " + sfu(x));
    scorer.add(false);
  } else {
    print("OK: " + sfu(x));
    scorer.add(true);
  }
}
endif

Author comment

Began life as a copy of #1002936

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1018446
Snippet name: assertEqualsVerbose_struct - print structs
Eternal ID of this version: #1018446/4
Text MD5: 82d3d6fa500b0fa0d2365b3bbeab0eec
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-06-07 18:07:43
Source code size: 580 bytes / 25 lines
Pitched / IR pitched: No / No
Views / Downloads: 238 / 305
Version history: 3 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)