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

9
LINES

< > BotCompany Repo | #1026547 - testFunctionValues_twoArgs_flat - call two-argument function, compare output and print

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2155L/14K).

// params = input1, input2, output, input1, input2, output, ...
svoid mapLike testFunctionValues_twoArgs_flat(O function, O... params) {
  for (int i = 0; i+2 < l(params); i += 3) {
    O a = params[i], b = params[i+1];
    O expected = params[i+2];
    print(function + "(" + a + ", " + b + ")");
    assertEqualsVerbose(expected, callFWithVarArgs(function, a, b));
  }
}

Author comment

Began life as a copy of #1023865

download  show line numbers  debug dex   

Travelled to 3 computer(s): mqqgnosmbjvj, tvejysmllsmz, xrpafgyirdlv

No comments. add comment

Snippet ID: #1026547
Snippet name: testFunctionValues_twoArgs_flat - call two-argument function, compare output and print
Eternal ID of this version: #1026547/3
Text MD5: d59eefd1d3627330263bdb9b9dfbedfe
Transpilation MD5: 3d171f8cf1c77fd17d585f791adf2c20
Author: stefan
Category: javax / testing
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-01-12 15:24:41
Source code size: 380 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 13 / 32
Version history: 2 change(s)
Referenced in: #1006654

Formerly at http://tinybrain.de/1026547 & http://1026547.tinybrain.de