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

40
LINES

< > BotCompany Repo | #1001542 // Indent Java Test Case Bot - developing

JavaX source code - run with: x30.jar

1  
!747
2  
3  
m {
4  
  // These must be correctly indented.
5  
  static S snippets = "#1001541 #1001437 #629 #1000985 #1001519";
6  
  
7  
  static new L<TestCase> cases;
8  
  
9  
  static class TestCase {
10  
    S name, input, output;
11  
    
12  
    *() {}
13  
    *(S *name, S *input, S *output) {}
14  
  }
15  
  
16  
  p {
17  
    L<S> lSnippets = codeTokensOnly(javaTokPlusPeriod(snippets));
18  
    for (S snippetID : lSnippets) {
19  
      L<S> text = toLines(loadSnippet(snippetID)); // TODO: better to load with wayback machine in case they change (Oct 23 2015, 19:57)
20  
      L<S> withoutIndent = removeIndent(text);
21  
      cases.add(new TestCase(snippetID, fromLines(withoutIndent), fromLines(text)));
22  
    }
23  
    
24  
    makeAndroid3("Indent Java Test Case Bot.");
25  
  }
26  
  
27  
  static synchronized S answer(S s) {
28  
    new Matches m;
29  
    if (match3("solution * for case * by *", m)) {
30  
      // TODO
31  
    }
32  
  }
33  
  
34  
  static L<S> removeIndent(L<S> text) {
35  
    new L<S> l;
36  
    for (S line : text)
37  
      l.add(ltrim(line));
38  
    ret l;
39  
  }
40  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1001542
Snippet name: Indent Java Test Case Bot - developing
Eternal ID of this version: #1001542/1
Text MD5: 0fb5ca727a202f7e032f2386742570d0
Author: stefan
Category:
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-10-23 20:06:36
Source code size: 1007 bytes / 40 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 672 / 611
Referenced in: [show references]