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

16
LINES

< > BotCompany Repo | #1034667 // TestFindEndOfBlockFunction

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

Libraryless. Click here for Pure Java version (5532L/31K).

1  
sclass TestFindEndOfBlockFunction {
2  
  swappable int functionToTest(LS tok, int i) { throw unimplemented(); }
3  
  int n = 20, repetitions = 1000;
4  
  
5  
  LS tok;
6  
  
7  
  run {
8  
    repeat repetitions {
9  
      tok = javaTok(repF(n, -> tossCoin() ? "{" : "}"));
10  
      print(join(tok));
11  
      int i = random(l(tok)) | 1;
12  
      assertEqualsVerbose("i=" + i, tok_findEndOfBlock(tok, i), functionToTest(tok, i));
13  
    }
14  
    print("OK after " + nRepetitions(repetitions));
15  
  }
16  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1034667
Snippet name: TestFindEndOfBlockFunction
Eternal ID of this version: #1034667/5
Text MD5: ce7bafb90fd208ffb34afda31a8149c3
Transpilation MD5: 65d8ef7eaf37d36643e7538285d88221
Author: stefan
Category: javax / transpiling
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-03-01 15:59:12
Source code size: 474 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 108 / 201
Version history: 4 change(s)
Referenced in: [show references]