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

42
LINES

< > BotCompany Repo | #1018476 // Test Expecters [usually OK]

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Libraryless. Click here for Pure Java version (8155L/60K).

1  
!7
2  
3  
p-exp {
4  
  loadFunctions_preferDiskCache();
5  
6  
  assertFalseVerbose(ExpectANumberOfLines(2).check(5));
7  
  assertFalseVerbose(ExpectANumberOfLines(2).check("one line"));
8  
  assertFalseVerbose(ExpectANumberOfLines(2).check("one line\n"));
9  
  assertTrueVerbose(ExpectANumberOfLines(2).check("one line\ntwo lines"));
10  
  assertTrueVerbose(ExpectANumberOfLines(2).check("one line\ntwo lines\n"));
11  
  
12  
  assertTrueVerbose(ExpectContainsOnce_string(".").check("a.b"));
13  
  assertFalseVerbose(ExpectContainsOnce_string(".").check("a..b"));
14  
  assertFalseVerbose(ExpectContainsOnce_string(".").check("a"));
15  
  
16  
  assertTrueVerbose(ExpectForEachLine(ExpectContainsOnce_string(".")).check("a.b\nc.d"));
17  
  assertFalseVerbose(ExpectForEachLine(ExpectContainsOnce_string(".")).check("a.b\nc,d"));
18  
  
19  
  assertTrueVerbose(ExpectInteger().check("1"));
20  
  assertTrueVerbose(ExpectInteger().check("-1"));
21  
  assertFalseVerbose(ExpectInteger().check("x"));
22  
  assertTrueVerbose(ExpectInteger().check(1));
23  
  
24  
  assertTrueVerbose(ExpectAfterSF('trim, new ExpectInteger).check(" 1 "));
25  
  assertFalseVerbose(ExpectAfterSF('trim, new ExpectInteger).check(" x "));
26  
  
27  
  assertTrueVerbose(ExpectElementAtIndex(0, 'bla).check(ll('bla, 'blubb)));
28  
  assertFalseVerbose(ExpectElementAtIndex(1, 'bla).check(ll('bla, 'blubb)));
29  
  assertTrueVerbose(ExpectElementAtIndex(1, 'blubb).check(ll('bla, 'blubb)));
30  
  assertFalseVerbose(ExpectElementAtIndex(0, 'blubb).check(ll('bla, 'blubb)));
31  
  
32  
  assertTrueVerbose(ExpectAnd(ExpectInteger(), ExpectEquals("5")).check("5"));
33  
  assertFalseVerbose(ExpectAnd(ExpectInteger(), ExpectEquals("x")).check("x"));
34  
  assertFalseVerbose(ExpectAnd(ExpectInteger(), ExpectEquals("x")).check("5"));
35  
  
36  
  assertTrueVerbose(ExpectNumberedLines().check("1. bla\n2. blubb"));
37  
  assertFalseVerbose(ExpectNumberedLines().check("1. bla\n3. blubb"));
38  
  assertFalseVerbose(ExpectNumberedLines().check("bla"));
39  
  
40  
  assertTrueVerbose(ExpectLength(2).check(ll("a", "b")));
41  
  assertFalseVerbose(ExpectLength(3).check(ll("a", "b")));
42  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1018476
Snippet name: Test Expecters [usually OK]
Eternal ID of this version: #1018476/13
Text MD5: e16f0a4c6cf15e15dea5dc6c38aa91f4
Transpilation MD5: 0f36cf614aa4011727dd2301c14f9f9e
Author: stefan
Category: javax / a.i.
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-10-01 22:23:37
Source code size: 2046 bytes / 42 lines
Pitched / IR pitched: No / No
Views / Downloads: 535 / 1287
Version history: 12 change(s)
Referenced in: [show references]