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

43
LINES

< > BotCompany Repo | #1031013 // Test new findConceptWhereCI (OK)

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Libraryless. Click here for Pure Java version (20356L/138K).

1  
!7
2  
3  
set flag findConceptWhereCI_debug.
4  
5  
concept CC {
6  
  S a, b;
7  
}
8  
9  
module > DynPrintLog {
10  
  start-thread {
11  
    CC cc = cnew(CC, a := "hello", b := "world");
12  
    ConceptFieldIndex<CC, S> index = new(mainConcepts, CC, "a");
13  
    assertEquals("world", index.get("hello").b);
14  
    assertNull(index.get("Hello"));
15  
    
16  
    cset(cc, a := "yo");
17  
    assertNull(index.get("hello"));
18  
    assertEquals("world", index.get("yo").b);
19  
    print("testing findConceptWhere");
20  
    assertEquals(cc, findConceptWhereCI(CC, a := "yo"));
21  
    assertNull(findConceptWhereCI(CC, a := "x"));
22  
    
23  
    print("testing delete");
24  
    cc.delete();
25  
    assertNull(index.get("yo"));
26  
    
27  
    cc = cnew(CC, a := "another", b := "test");
28  
    assertEquals("test", index.get("another").b);
29  
    
30  
    // Test null values
31  
    
32  
    print("testing null");
33  
    cc = cnew(CC, a := null, b := "nullie");
34  
    assertEquals(cc, index.get(null));
35  
    
36  
    print("testing not null anymore");
37  
    cset(cc, a := "x");
38  
    assertEquals(cc, index.get("x"));
39  
    assertNull(index.get(null));
40  
  
41  
    print("OK");
42  
  }
43  
}

Author comment

Began life as a copy of #1008615

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1031013
Snippet name: Test new findConceptWhereCI (OK)
Eternal ID of this version: #1031013/4
Text MD5: 917e60d456188b40d304570c27521df1
Transpilation MD5: b5301b0b2aa66470c6089e6ea2017901
Author: stefan
Category: javax / concepts
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-04-21 16:53:05
Source code size: 1102 bytes / 43 lines
Pitched / IR pitched: No / No
Views / Downloads: 173 / 246
Version history: 3 change(s)
Referenced in: [show references]