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

13
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 (2225L/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));
  }
}

svoid testFunctionValues_twoArgs_flat(IF2 function, O... params) {
  testFunctionValues_twoArgs_flat((O) function, params);
}

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/4
Text MD5: 3c0834264dff8fb6beb81a6b1ed27200
Transpilation MD5: 3f3674589c16f46e060306925ca4aa6d
Author: stefan
Category: javax / testing
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-03-22 14:01:17
Source code size: 511 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 21 / 49
Version history: 3 change(s)
Referenced in: [show references]

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