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

16
LINES

< > BotCompany Repo | #1030874 // test_uniqCI (with dynamic reference field)

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

Libraryless. Click here for Pure Java version (15763L/101K).

1  
svoid test_uniqCI() {
2  
  // try old & new mode
3  
  for (bool collectForwardRefs : ll(true, false)) {
4  
    new Concepts cc;
5  
    cc.collectForwardRefs = collectForwardRefs;
6  
    Concept a = cnew(cc, Concept);
7  
    Concept b = uniqCI(cc, Concept, myRef := a);
8  
    assertSameVerbose(cc, a.concepts());
9  
    assertSameVerbose(cc, b.concepts());
10  
    assertEqualsVerbose(a, cget(b, "myRef"));
11  
    assertEqualsVerbose("refs field", collectForwardRefs, b._rawRefsField() != null);
12  
    assertEqualsVerbose("num refs", 1, l(b._refs()));
13  
    assertEqualsVerbose("num back refs", 1, l(a.backRefs));
14  
    assertEquals(ll(b), findBackRefs(a));
15  
  }
16  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1030874
Snippet name: test_uniqCI (with dynamic reference field)
Eternal ID of this version: #1030874/8
Text MD5: 7034163226d502ea6bc5825edd7ae652
Transpilation MD5: 4702acb3e7562e83722437039e355054
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-05-12 23:42:49
Source code size: 641 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 120 / 209
Version history: 7 change(s)
Referenced in: [show references]