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

31
LINES

< > BotCompany Repo | #1023898 // test_AllOnAll

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

Libraryless. Click here for Pure Java version (2582L/16K).

svoid test_AllOnAll() {
  for (bool variation : falseTrue()) {
    new AllOnAll<S, Int> aoa;
    aoa.newA("one");
    assertNullVerbose(aoa.next());
    aoa.newB(1);
    assertEqualsVerbose(pair("one", 1), aoa.next());
    assertNullVerbose(aoa.next());
    aoa.newB(2);
    if (!variation) aoa.newA("two");
    assertEqualsVerbose(pair("one", 2), aoa.next());
    if (variation) {
      assertNullVerbose(aoa.next());
      aoa.newA("two");
    }
    assertEqualsVerbose(pair("two", 1), aoa.next());
    assertEqualsVerbose(pair("two", 2), aoa.next());
    assertNullVerbose(aoa.next());
  }
  
  new AllOnAll<S, Int> aoa;
  aoa.newA("one");
  aoa.newB(1);
  aoa.newA("two");
  aoa.newB(2);
  assertEqualsVerbose(pair("one", 1), aoa.next());
  assertEqualsVerbose(pair("two", 1), aoa.next());
  assertEqualsVerbose(pair("one", 2), aoa.next());
  assertEqualsVerbose(pair("two", 2), aoa.next());
  assertNullVerbose(aoa.next());
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1023898
Snippet name: test_AllOnAll
Eternal ID of this version: #1023898/5
Text MD5: 9169d0f8335c6780aecea524905e7ec5
Transpilation MD5: 8cacdd31a2ee33922ca1ef4e43c3a6db
Author: stefan
Category: jaax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-07-11 23:01:32
Source code size: 960 bytes / 31 lines
Pitched / IR pitched: No / No
Views / Downloads: 217 / 294
Version history: 4 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1023908 - test_AllOnAllWithUpdates (OK)