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

41
LINES

< > BotCompany Repo | #1009421 // PersistentLister TreeMap Bug Test [OK]

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (8063L/54K/181K).

!7

static Map<S, Long> map;

//set flag structure_debug.
set flag unstructure_debug.

p {
  deleteDB();
  l_persistentLister();
  map = l_getTreeMap("German words with count");
  checkMap(0);
  map = l_getTreeMap("German words with count");
  checkMap(0);
  sleepSeconds(2);
  longMultiSet_add(map, "Hallo");
  print("Words now: " + sfu(map));
  assertEquals(1, l(map));
  
  l_persistentLister(null);
  l_dropDefaultLister();
  dbOff();
  print("\nOn disk: " + loadConceptsStructure() + "\n");
  
  db();
  l_persistentLister();
  map = l_getTreeMap("German words with count");
  checkMap(1);
  
  dbOff();
  print("\nOn disk: " + loadConceptsStructure() + "\n");
}

svoid checkMap(int size) {
  print("Map type: " + className(map) + ", hash code: " + identityHashCode(map));
  assertTrue(map << MapInConcept);
  assertTrue("Map sane", getOpt_raw(map, 'm) != null);
  assertEquals(size, l(map));
  print("Size: " + l(map));
  print("Words: " + sfu(map));
}

Author comment

Began life as a copy of #1009416

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1009421
Snippet name: PersistentLister TreeMap Bug Test [OK]
Eternal ID of this version: #1009421/19
Text MD5: 06f5c692c81da2a1f64141b99dc74bf8
Transpilation MD5: 43619a02cfe0d87d96ebd07798a4a34f
Author: stefan
Category: javax / a.i.
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-08-01 19:32:29
Source code size: 998 bytes / 41 lines
Pitched / IR pitched: No / No
Views / Downloads: 516 / 759
Version history: 18 change(s)
Referenced in: [show references]