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

9
LINES

< > BotCompany Repo | #1029427 // test_LCSortedPairIndex

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

Libraryless. Click here for Pure Java version (4469L/29K).

1  
svoid test_LCSortedPairIndex() {
2  
  long pairs[] = toLongArray(shuffled(lmap toLong(ll(500, 1000, 1500, 2000, 2500, 3000, 3500, 4000, 4500, 5000, 5500))));
3  
  printStruct(pairs);
4  
  LCSortedPairIndex index = new(pairs);
5  
  printStruct(index.index);
6  
  for i over pairs:
7  
    assertEqualsVerbose(i, index.get(pairs[i]));
8  
  assertEquals(-1, index.get(777));
9  
}

Author comment

Began life as a copy of #1029420

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1029427
Snippet name: test_LCSortedPairIndex
Eternal ID of this version: #1029427/9
Text MD5: 8df5bcce2630e51d7323d6769fd6a5ad
Transpilation MD5: ed38234f70aad8cb0a40dbc0555736cd
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-08-05 22:11:47
Source code size: 359 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 249 / 372
Version history: 8 change(s)
Referenced in: [show references]