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).

!7

set flag findConceptWhereCI_debug.

concept CC {
  S a, b;
}

module > DynPrintLog {
  start-thread {
    CC cc = cnew(CC, a := "hello", b := "world");
    ConceptFieldIndex<CC, S> index = new(mainConcepts, CC, "a");
    assertEquals("world", index.get("hello").b);
    assertNull(index.get("Hello"));
    
    cset(cc, a := "yo");
    assertNull(index.get("hello"));
    assertEquals("world", index.get("yo").b);
    print("testing findConceptWhere");
    assertEquals(cc, findConceptWhereCI(CC, a := "yo"));
    assertNull(findConceptWhereCI(CC, a := "x"));
    
    print("testing delete");
    cc.delete();
    assertNull(index.get("yo"));
    
    cc = cnew(CC, a := "another", b := "test");
    assertEquals("test", index.get("another").b);
    
    // Test null values
    
    print("testing null");
    cc = cnew(CC, a := null, b := "nullie");
    assertEquals(cc, index.get(null));
    
    print("testing not null anymore");
    cset(cc, a := "x");
    assertEquals(cc, index.get("x"));
    assertNull(index.get(null));
  
    print("OK");
  }
}

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: 171 / 242
Version history: 3 change(s)
Referenced in: [show references]