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

18
LINES

< > BotCompany Repo | #1022096 - Test call_withVarargs & callOpt_withVarargs [OK]

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (6220L/44K).

!7

sclass Bla {
  S ok(S s) { ret s + " " + s; }
  S ok(S s, S... x) { ret s + " " + joinWithComma(x); }
  S single(S... x) { ret joinWithComma(x); }
}

p-exp {
  assertEqualsVerbose("hello hello", call_withVarargs(new Bla, 'ok, 'hello));
  assertEqualsVerbose("hello what's, up", call_withVarargs(new Bla, 'ok, 'hello, "what's", 'up));
  
  assertEqualsVerbose("hello hello", callOpt_withVarargs(new Bla, 'ok, 'hello));
  assertEqualsVerbose("hello what's, up", callOpt_withVarargs(new Bla, 'ok, 'hello, "what's", 'up));
  assertNullVerbose(callOpt_withVarargs(new Bla, 'ok, "", 5));
  
  assertEqualsVerbose("a, b", callOpt_withVarargs(new Bla, 'single, 'a, 'b));
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1022096
Snippet name: Test call_withVarargs & callOpt_withVarargs [OK]
Eternal ID of this version: #1022096/6
Text MD5: 9abef586cb8455002641d8b4896ee5d5
Transpilation MD5: 02ee3a2867472413fa59c46f16c149b1
Author: stefan
Category: javax
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-03-15 08:40:24
Source code size: 685 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 123 / 218
Version history: 5 change(s)
Referenced in: [show references]