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

16
LINES

< > BotCompany Repo | #1030747 // test_replaceConceptAndUpdateRefs (OK)

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

Libraryless. Click here for Pure Java version (14773L/94K).

1  
svoid test_replaceConceptAndUpdateRefs() {
2  
  new Concepts cc;
3  
  Concept a = cnew(cc, "A");
4  
  Concept b = cnew(cc, "B");
5  
  Concept a2 = unlisted("A");
6  
  cset(b, +a);
7  
  print(+a);
8  
  print(+b);
9  
  long id = a.id;
10  
  replaceConceptAndUpdateRefs(a, a2);
11  
  print(+a2);
12  
  print(+b);
13  
  assertSame(cc, a2.concepts());
14  
  assertEquals(id, a2.id);
15  
  assertEquals(allBackRefs(a2), ll(b));
16  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1030747
Snippet name: test_replaceConceptAndUpdateRefs (OK)
Eternal ID of this version: #1030747/3
Text MD5: c451dbbdf62d8c86d270a5fb86618d74
Transpilation MD5: 5ace05c3c970270ca970618f21162f62
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-03-18 22:13:55
Source code size: 390 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 182 / 242
Version history: 2 change(s)
Referenced in: [show references]