# Test suite for Local_to_global. # Copyright (C) 1999, 2003 Lysator Academic Computer Association. # # This file is part of the LysKOM server. # # LysKOM is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 1, or (at your option) # any later version. # # LysKOM is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License # along with LysKOM; see the file COPYING. If not, write to # Lysator, c/o ISY, Linkoping University, S-581 83 Linkoping, SWEDEN, # or the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, # MA 02139, USA. # # Please report bugs at http://bugzilla.lysator.liu.se/. # Check compaction of blocks. l2g_start l2g_send "I0" # Append 25 random numbers in the range 1..1000, simulating some # sparse old marked texts. l2g_send "a0 35 53428" l2g_send "a0 50 57456" l2g_send "a0 222 59570" l2g_send "a0 259 70441" l2g_send "a0 304 72037" l2g_send "a0 329 72239" l2g_send "a0 358 72910" l2g_send "a0 383 73113" l2g_send "a0 389 73612" l2g_send "a0 395 76393" l2g_send "a0 445 77697" l2g_send "a0 474 78372" l2g_send "a0 482 79436" l2g_send "a0 539 80907" l2g_send "a0 602 84499" l2g_send "a0 612 87035" l2g_send "a0 618 87514" l2g_send "a0 688 88856" l2g_send "a0 792 89215" l2g_send "a0 849 92418" l2g_send "a0 922 93794" l2g_send "a0 923 94866" l2g_send "a0 933 95724" l2g_send "a0 948 97085" l2g_send "a0 992 97960" l2g_send "w0" simple_expect "\\\[993 35:53428 50:57456 222:59570 259:70441 304:72037 329:72239 358:72910 383:73113 389:73612 395:76393 445:77697 474:78372 482:79436 539:80907 602:84499 612:87035 618:87514 688:88856 792:89215 849:92418 922:93794,94866 933:95724 948:97085 992:97960\\\]" # Insert 25 numbers in the range 1001..1025, simulating newly created # texts. l2g_send "a0 1001 101613" l2g_send "a0 1002 102864" l2g_send "a0 1003 103254" l2g_send "a0 1004 103935" l2g_send "a0 1005 104444" l2g_send "a0 1006 105551" l2g_send "a0 1007 105859" l2g_send "a0 1008 106390" l2g_send "a0 1009 106784" l2g_send "a0 1010 107002" l2g_send "a0 1011 107212" l2g_send "a0 1012 107324" l2g_send "a0 1013 107469" l2g_send "a0 1014 107571" l2g_send "a0 1015 108471" l2g_send "a0 1016 108592" l2g_send "a0 1017 109959" l2g_send "a0 1018 111141" l2g_send "a0 1019 111225" l2g_send "a0 1020 113738" l2g_send "a0 1021 116365" l2g_send "a0 1022 117110" l2g_send "a0 1023 117278" l2g_send "a0 1024 117886" l2g_send "a0 1025 119385" l2g_send "w0" simple_expect "\\\[1026 35:53428 50:57456 222:59570 259:70441 304:72037 329:72239 358:72910 383:73113 389:73612 395:76393 445:77697 474:78372 482:79436 539:80907 602:84499 612:87035 618:87514 688:88856 792:89215 849:92418 922:93794,94866 933:95724 948:97085 992:97960 1001:101613,102864,103254,103935,104444,105551,105859,106390,106784,107002,107212,107324,107469,107571,108471,108592,109959,111141,111225,113738,116365,117110,117278,117886,119385\\\]" # Check that we've got three sparse blocks and two dense. All of them # are optimally packed. l2g_send "u0" simple_expect "Number of blocks: 5" simple_expect "First unused: 1026" simple_expect "0: 10 0 35 \\(sparse\\) \\\[35:53428 50:57456 222:59570 259:70441 304:72037 329:72239 358:72910 383:73113 389:73612 395:76393 \\\]" simple_expect "1: 10 0 445 \\(sparse\\) \\\[445:77697 474:78372 482:79436 539:80907 602:84499 612:87035 618:87514 688:88856 792:89215 849:92418 \\\]" simple_expect "2: 10 0 922 \\(sparse\\) \\\[922:93794 923:94866 933:95724 948:97085 992:97960 1001:101613 1002:102864 1003:103254 1004:103935 1005:104444 \\\]" simple_expect "3: 10 0 1006 \\(dense\\) \\\[105551 105859 106390 106784 107002 107212 107324 107469 107571 108471 \\\]" simple_expect "4: 10 0 1016 \\(dense\\) \\\[108592 109959 111141 111225 113738 116365 117110 117278 117886 119385 \\\]" # Remove some data from block 1 and ensure that it is not compacted # too early. l2g_send "d0 445" l2g_send "d0 849" l2g_send "d0 482" l2g_send "d0 612" l2g_send "d0 602" l2g_send "u0" simple_expect "Number of blocks: 5" simple_expect "First unused: 1026" simple_expect "0: 10 0 35 \\(sparse\\) \\\[35:53428 50:57456 222:59570 259:70441 304:72037 329:72239 358:72910 383:73113 389:73612 395:76393 \\\]" simple_expect "1: 10 5 445 \\(sparse\\) \\\[445:0 474:78372 482:0 539:80907 602:0 612:0 618:87514 688:88856 792:89215 849:0 \\\]" simple_expect "2: 10 0 922 \\(sparse\\) \\\[922:93794 923:94866 933:95724 948:97085 992:97960 1001:101613 1002:102864 1003:103254 1004:103935 1005:104444 \\\]" simple_expect "3: 10 0 1006 \\(dense\\) \\\[105551 105859 106390 106784 107002 107212 107324 107469 107571 108471 \\\]" simple_expect "4: 10 0 1016 \\(dense\\) \\\[108592 109959 111141 111225 113738 116365 117110 117278 117886 119385 \\\]" l2g_send "w0" simple_expect "\\\[1026 35:53428 50:57456 222:59570 259:70441 304:72037 329:72239 358:72910 383:73113 389:73612 395:76393 474:78372 539:80907 618:87514 688:88856 792:89215 922:93794,94866 933:95724 948:97085 992:97960 1001:101613,102864,103254,103935,104444,105551,105859,106390,106784,107002,107212,107324,107469,107571,108471,108592,109959,111141,111225,113738,116365,117110,117278,117886,119385\\\]" # Delete one more item and ensure that it is compacted. l2g_send "d0 539" l2g_send "u0" simple_expect "Number of blocks: 5" simple_expect "First unused: 1026" simple_expect "0: 10 0 35 \\(sparse\\) \\\[35:53428 50:57456 222:59570 259:70441 304:72037 329:72239 358:72910 383:73113 389:73612 395:76393 \\\]" simple_expect "1: 4 6 445 \\(sparse\\) \\\[474:78372 618:87514 688:88856 792:89215 \\\]" simple_expect "2: 10 0 922 \\(sparse\\) \\\[922:93794 923:94866 933:95724 948:97085 992:97960 1001:101613 1002:102864 1003:103254 1004:103935 1005:104444 \\\]" simple_expect "3: 10 0 1006 \\(dense\\) \\\[105551 105859 106390 106784 107002 107212 107324 107469 107571 108471 \\\]" simple_expect "4: 10 0 1016 \\(dense\\) \\\[108592 109959 111141 111225 113738 116365 117110 117278 117886 119385 \\\]" l2g_send "w0" simple_expect "\\\[1026 35:53428 50:57456 222:59570 259:70441 304:72037 329:72239 358:72910 383:73113 389:73612 395:76393 474:78372 618:87514 688:88856 792:89215 922:93794,94866 933:95724 948:97085 992:97960 1001:101613,102864,103254,103935,104444,105551,105859,106390,106784,107002,107212,107324,107469,107571,108471,108592,109959,111141,111225,113738,116365,117110,117278,117886,119385\\\]" # Check that lookup of 445..474 works properly. l2g_send "l0 444" simple_expect "0" l2g_send "l0 445" simple_expect "0" l2g_send "l0 446" simple_expect "0" l2g_send "l0 447" simple_expect "0" l2g_send "l0 472" simple_expect "0" l2g_send "l0 473" simple_expect "0" l2g_send "l0 474" simple_expect "78372" l2g_send "l0 475" simple_expect "0" # Check iterators l2g_send "i0" simple_expect "35:53428" simple_expect "50:57456" simple_expect "222:59570" simple_expect "259:70441" simple_expect "304:72037" simple_expect "329:72239" simple_expect "358:72910" simple_expect "383:73113" simple_expect "389:73612" simple_expect "395:76393" simple_expect "474:78372" simple_expect "618:87514" simple_expect "688:88856" simple_expect "792:89215" simple_expect "922:93794" simple_expect "923:94866" simple_expect "933:95724" simple_expect "948:97085" simple_expect "992:97960" simple_expect "1001:101613" simple_expect "1002:102864" simple_expect "1003:103254" simple_expect "1004:103935" simple_expect "1005:104444" simple_expect "1006:105551" simple_expect "1007:105859" simple_expect "1008:106390" simple_expect "1009:106784" simple_expect "1010:107002" simple_expect "1011:107212" simple_expect "1012:107324" simple_expect "1013:107469" simple_expect "1014:107571" simple_expect "1015:108471" simple_expect "1016:108592" simple_expect "1017:109959" simple_expect "1018:111141" simple_expect "1019:111225" simple_expect "1020:113738" simple_expect "1021:116365" simple_expect "1022:117110" simple_expect "1023:117278" simple_expect "1024:117886" simple_expect "1025:119385" l2g_send "i0 444 475" simple_expect "474:78372" l2g_send "i0 445 475" simple_expect "474:78372" l2g_send "i0 446 475" simple_expect "474:78372" l2g_send "i0 446 474" # Check reverse iterators l2g_send "b0 0 9999" simple_expect "1025:119385" simple_expect "1024:117886" simple_expect "1023:117278" simple_expect "1022:117110" simple_expect "1021:116365" simple_expect "1020:113738" simple_expect "1019:111225" simple_expect "1018:111141" simple_expect "1017:109959" simple_expect "1016:108592" simple_expect "1015:108471" simple_expect "1014:107571" simple_expect "1013:107469" simple_expect "1012:107324" simple_expect "1011:107212" simple_expect "1010:107002" simple_expect "1009:106784" simple_expect "1008:106390" simple_expect "1007:105859" simple_expect "1006:105551" simple_expect "1005:104444" simple_expect "1004:103935" simple_expect "1003:103254" simple_expect "1002:102864" simple_expect "1001:101613" simple_expect "992:97960" simple_expect "948:97085" simple_expect "933:95724" simple_expect "923:94866" simple_expect "922:93794" simple_expect "792:89215" simple_expect "688:88856" simple_expect "618:87514" simple_expect "474:78372" simple_expect "395:76393" simple_expect "389:73612" simple_expect "383:73113" simple_expect "358:72910" simple_expect "329:72239" simple_expect "304:72037" simple_expect "259:70441" simple_expect "222:59570" simple_expect "50:57456" simple_expect "35:53428" l2g_send "b0 444 475" simple_expect "474:78372" l2g_send "b0 445 475" simple_expect "474:78372" l2g_send "b0 446 475" simple_expect "474:78372" l2g_send "b0 446 474" # Remove three items from block 2 and ensure that no compaction happens. l2g_send "d0 923" l2g_send "d0 1001" l2g_send "d0 1002" l2g_send "u0" simple_expect "Number of blocks: 5" simple_expect "First unused: 1026" simple_expect "0: 10 0 35 \\(sparse\\) \\\[35:53428 50:57456 222:59570 259:70441 304:72037 329:72239 358:72910 383:73113 389:73612 395:76393 \\\]" simple_expect "1: 4 6 445 \\(sparse\\) \\\[474:78372 618:87514 688:88856 792:89215 \\\]" simple_expect "2: 10 3 922 \\(sparse\\) \\\[922:93794 923:0 933:95724 948:97085 992:97960 1001:0 1002:0 1003:103254 1004:103935 1005:104444 \\\]" simple_expect "3: 10 0 1006 \\(dense\\) \\\[105551 105859 106390 106784 107002 107212 107324 107469 107571 108471 \\\]" simple_expect "4: 10 0 1016 \\(dense\\) \\\[108592 109959 111141 111225 113738 116365 117110 117278 117886 119385 \\\]" l2g_send "w0" simple_expect "\\\[1026 35:53428 50:57456 222:59570 259:70441 304:72037 329:72239 358:72910 383:73113 389:73612 395:76393 474:78372 618:87514 688:88856 792:89215 922:93794 933:95724 948:97085 992:97960 1003:103254,103935,104444,105551,105859,106390,106784,107002,107212,107324,107469,107571,108471,108592,109959,111141,111225,113738,116365,117110,117278,117886,119385\\\]" # Remove one more item from block 2 and watch it merge with block 1. l2g_send "d0 1003" l2g_send "u0" simple_expect "Number of blocks: 4" simple_expect "First unused: 1026" simple_expect "0: 10 0 35 \\(sparse\\) \\\[35:53428 50:57456 222:59570 259:70441 304:72037 329:72239 358:72910 383:73113 389:73612 395:76393 \\\]" simple_expect "1: 10 0 445 \\(sparse\\) \\\[474:78372 618:87514 688:88856 792:89215 922:93794 933:95724 948:97085 992:97960 1004:103935 1005:104444 \\\]" simple_expect "2: 10 0 1006 \\(dense\\) \\\[105551 105859 106390 106784 107002 107212 107324 107469 107571 108471 \\\]" simple_expect "3: 10 0 1016 \\(dense\\) \\\[108592 109959 111141 111225 113738 116365 117110 117278 117886 119385 \\\]" l2g_send "w0" simple_expect "\\\[1026 35:53428 50:57456 222:59570 259:70441 304:72037 329:72239 358:72910 383:73113 389:73612 395:76393 474:78372 618:87514 688:88856 792:89215 922:93794 933:95724 948:97085 992:97960 1004:103935,104444,105551,105859,106390,106784,107002,107212,107324,107469,107571,108471,108592,109959,111141,111225,113738,116365,117110,117278,117886,119385\\\]" # Remove all but one item from the current block 2 (simualting a # massive garb effort). l2g_send "d0 1006" l2g_send "w0" simple_expect "\\\[1026 35:53428 50:57456 222:59570 259:70441 304:72037 329:72239 358:72910 383:73113 389:73612 395:76393 474:78372 618:87514 688:88856 792:89215 922:93794 933:95724 948:97085 992:97960 1004:103935,104444,0,105859,106390,106784,107002,107212,107324,107469,107571,108471,108592,109959,111141,111225,113738,116365,117110,117278,117886,119385\\\]" l2g_send "d0 1007" l2g_send "w0" simple_expect "\\\[1026 35:53428 50:57456 222:59570 259:70441 304:72037 329:72239 358:72910 383:73113 389:73612 395:76393 474:78372 618:87514 688:88856 792:89215 922:93794 933:95724 948:97085 992:97960 1004:103935,104444,0,0,106390,106784,107002,107212,107324,107469,107571,108471,108592,109959,111141,111225,113738,116365,117110,117278,117886,119385\\\]" l2g_send "d0 1008" l2g_send "w0" simple_expect "\\\[1026 35:53428 50:57456 222:59570 259:70441 304:72037 329:72239 358:72910 383:73113 389:73612 395:76393 474:78372 618:87514 688:88856 792:89215 922:93794 933:95724 948:97085 992:97960 1004:103935,104444 1009:106784,107002,107212,107324,107469,107571,108471,108592,109959,111141,111225,113738,116365,117110,117278,117886,119385\\\]" l2g_send "d0 1009" l2g_send "w0" simple_expect "\\\[1026 35:53428 50:57456 222:59570 259:70441 304:72037 329:72239 358:72910 383:73113 389:73612 395:76393 474:78372 618:87514 688:88856 792:89215 922:93794 933:95724 948:97085 992:97960 1004:103935,104444 1010:107002,107212,107324,107469,107571,108471,108592,109959,111141,111225,113738,116365,117110,117278,117886,119385\\\]" l2g_send "d0 1010" l2g_send "d0 1011" l2g_send "d0 1012" l2g_send "d0 1013" l2g_send "d0 1014" l2g_send "w0" simple_expect "\\\[1026 35:53428 50:57456 222:59570 259:70441 304:72037 329:72239 358:72910 383:73113 389:73612 395:76393 474:78372 618:87514 688:88856 792:89215 922:93794 933:95724 948:97085 992:97960 1004:103935,104444 1015:108471,108592,109959,111141,111225,113738,116365,117110,117278,117886,119385\\\]" # Delete a nonexisting text that would have been present in a dense block. l2g_send "d0 1012" l2g_send "u0" simple_expect "Number of blocks: 4" simple_expect "First unused: 1026" simple_expect "0: 10 0 35 \\(sparse\\) \\\[35:53428 50:57456 222:59570 259:70441 304:72037 329:72239 358:72910 383:73113 389:73612 395:76393 \\\]" simple_expect "1: 10 0 445 \\(sparse\\) \\\[474:78372 618:87514 688:88856 792:89215 922:93794 933:95724 948:97085 992:97960 1004:103935 1005:104444 \\\]" simple_expect "2: 10 9 1006 \\(dense\\) \\\[0 0 0 0 0 0 0 0 0 108471 \\\]" simple_expect "3: 10 0 1016 \\(dense\\) \\\[108592 109959 111141 111225 113738 116365 117110 117278 117886 119385 \\\]" # Remove the last data in block 2, causing it to be removed. l2g_send "d0 1015" l2g_send "u0" simple_expect "Number of blocks: 3" simple_expect "First unused: 1026" simple_expect "0: 10 0 35 \\(sparse\\) \\\[35:53428 50:57456 222:59570 259:70441 304:72037 329:72239 358:72910 383:73113 389:73612 395:76393 \\\]" simple_expect "1: 10 0 445 \\(sparse\\) \\\[474:78372 618:87514 688:88856 792:89215 922:93794 933:95724 948:97085 992:97960 1004:103935 1005:104444 \\\]" simple_expect "2: 10 0 1016 \\(dense\\) \\\[108592 109959 111141 111225 113738 116365 117110 117278 117886 119385 \\\]" # Delete a nonexisting text that would have been present in a sparse block. l2g_send "d0 40" # Delete a nonexisting text that cannot be present. l2g_send "d0 20" l2g_send "d0 2000" # Make sure nothing bad happened. l2g_send "u0" simple_expect "Number of blocks: 3" simple_expect "First unused: 1026" simple_expect "0: 10 0 35 \\(sparse\\) \\\[35:53428 50:57456 222:59570 259:70441 304:72037 329:72239 358:72910 383:73113 389:73612 395:76393 \\\]" simple_expect "1: 10 0 445 \\(sparse\\) \\\[474:78372 618:87514 688:88856 792:89215 922:93794 933:95724 948:97085 992:97960 1004:103935 1005:104444 \\\]" simple_expect "2: 10 0 1016 \\(dense\\) \\\[108592 109959 111141 111225 113738 116365 117110 117278 117886 119385 \\\]" l2g_send "w0" simple_expect "\\\[1026 35:53428 50:57456 222:59570 259:70441 304:72037 329:72239 358:72910 383:73113 389:73612 395:76393 474:78372 618:87514 688:88856 792:89215 922:93794 933:95724 948:97085 992:97960 1004:103935,104444 1016:108592,109959,111141,111225,113738,116365,117110,117278,117886,119385\\\]" # Insert one and a half new blocks. l2g_send "a0 1026 120115" l2g_send "a0 1027 122073" l2g_send "a0 1028 123273" l2g_send "a0 1029 125065" l2g_send "a0 1030 125444" l2g_send "a0 1031 125537" l2g_send "a0 1032 127933" l2g_send "a0 1033 128542" l2g_send "a0 1034 129196" l2g_send "a0 1035 129907" l2g_send "a0 1036 130515" l2g_send "a0 1037 131081" l2g_send "a0 1038 131308" l2g_send "a0 1039 132341" l2g_send "a0 1040 134218" l2g_send "u0" simple_expect "Number of blocks: 5" simple_expect "First unused: 1041" simple_expect "0: 10 0 35 \\(sparse\\) \\\[35:53428 50:57456 222:59570 259:70441 304:72037 329:72239 358:72910 383:73113 389:73612 395:76393 \\\]" simple_expect "1: 10 0 445 \\(sparse\\) \\\[474:78372 618:87514 688:88856 792:89215 922:93794 933:95724 948:97085 992:97960 1004:103935 1005:104444 \\\]" simple_expect "2: 10 0 1016 \\(dense\\) \\\[108592 109959 111141 111225 113738 116365 117110 117278 117886 119385 \\\]" simple_expect "3: 10 0 1026 \\(dense\\) \\\[120115 122073 123273 125065 125444 125537 127933 128542 129196 129907 \\\]" simple_expect "4: 5 5 1036 \\(dense\\) \\\[130515 131081 131308 132341 134218 \\\]" l2g_send "w0" simple_expect "\\\[1041 35:53428 50:57456 222:59570 259:70441 304:72037 329:72239 358:72910 383:73113 389:73612 395:76393 474:78372 618:87514 688:88856 792:89215 922:93794 933:95724 948:97085 992:97960 1004:103935,104444 1016:108592,109959,111141,111225,113738,116365,117110,117278,117886,119385,120115,122073,123273,125065,125444,125537,127933,128542,129196,129907,130515,131081,131308,132341,134218\\\]" # Remove a few text from block 3 and 2, but not enough to matter. l2g_send "d0 1027" l2g_send "d0 1028" l2g_send "d0 1017" l2g_send "d0 1018" l2g_send "w0" simple_expect "\\\[1041 35:53428 50:57456 222:59570 259:70441 304:72037 329:72239 358:72910 383:73113 389:73612 395:76393 474:78372 618:87514 688:88856 792:89215 922:93794 933:95724 948:97085 992:97960 1004:103935,104444 1016:108592,0,0,111225,113738,116365,117110,117278,117886,119385,120115,0,0,125065,125444,125537,127933,128542,129196,129907,130515,131081,131308,132341,134218\\\]" l2g_send "d0 1029" l2g_send "w0" simple_expect "\\\[1041 35:53428 50:57456 222:59570 259:70441 304:72037 329:72239 358:72910 383:73113 389:73612 395:76393 474:78372 618:87514 688:88856 792:89215 922:93794 933:95724 948:97085 992:97960 1004:103935,104444 1016:108592,0,0,111225,113738,116365,117110,117278,117886,119385,120115 1030:125444,125537,127933,128542,129196,129907,130515,131081,131308,132341,134218\\\]" l2g_send "u0" simple_expect "Number of blocks: 5" simple_expect "First unused: 1041" simple_expect "0: 10 0 35 \\(sparse\\) \\\[35:53428 50:57456 222:59570 259:70441 304:72037 329:72239 358:72910 383:73113 389:73612 395:76393 \\\]" simple_expect "1: 10 0 445 \\(sparse\\) \\\[474:78372 618:87514 688:88856 792:89215 922:93794 933:95724 948:97085 992:97960 1004:103935 1005:104444 \\\]" simple_expect "2: 10 2 1016 \\(dense\\) \\\[108592 0 0 111225 113738 116365 117110 117278 117886 119385 \\\]" simple_expect "3: 10 3 1026 \\(dense\\) \\\[120115 0 0 0 125444 125537 127933 128542 129196 129907 \\\]" simple_expect "4: 5 5 1036 \\(dense\\) \\\[130515 131081 131308 132341 134218 \\\]" # Remove a few more text from block 3 and 2, but still not enough to matter. l2g_send "d0 1030" l2g_send "d0 1019" l2g_send "d0 1020" l2g_send "d0 1021" l2g_send "d0 1031" l2g_send "d0 1032" l2g_send "d0 1033" l2g_send "d0 1039" l2g_send "d0 1040" l2g_send "u0" simple_expect "Number of blocks: 5" simple_expect "First unused: 1041" simple_expect "0: 10 0 35 \\(sparse\\) \\\[35:53428 50:57456 222:59570 259:70441 304:72037 329:72239 358:72910 383:73113 389:73612 395:76393 \\\]" simple_expect "1: 10 0 445 \\(sparse\\) \\\[474:78372 618:87514 688:88856 792:89215 922:93794 933:95724 948:97085 992:97960 1004:103935 1005:104444 \\\]" simple_expect "2: 10 5 1016 \\(dense\\) \\\[108592 0 0 0 0 0 117110 117278 117886 119385 \\\]" simple_expect "3: 10 7 1026 \\(dense\\) \\\[120115 0 0 0 0 0 0 0 129196 129907 \\\]" simple_expect "4: 5 7 1036 \\(dense\\) \\\[130515 131081 131308 0 0 \\\]" # Remove an item from block 2, causing the three last blocks to # merge into one. l2g_send "d0 1016" l2g_send "u0" simple_expect "Number of blocks: 3" simple_expect "First unused: 1041" simple_expect "0: 10 0 35 \\(sparse\\) \\\[35:53428 50:57456 222:59570 259:70441 304:72037 329:72239 358:72910 383:73113 389:73612 395:76393 \\\]" simple_expect "1: 10 0 445 \\(sparse\\) \\\[474:78372 618:87514 688:88856 792:89215 922:93794 933:95724 948:97085 992:97960 1004:103935 1005:104444 \\\]" simple_expect "2: 10 0 1016 \\(sparse\\) \\\[1022:117110 1023:117278 1024:117886 1025:119385 1026:120115 1034:129196 1035:129907 1036:130515 1037:131081 1038:131308 \\\]" l2g_send "a0 1030 33329" simple_expect "\[0-9\]\[0-9\]\[0-9\]\[0-9\]\[0-9\]\[0-9\] \[0-9\]\[0-9\]:\[0-9\]\[0-9\]:\[0-9\]\[0-9\] \[0-9\]\[0-9\]* l2g_append: won't add 33329<1030> when first_unused=1041" l2g_send "i0 0 10" simple_expect "\[0-9\]\[0-9\]\[0-9\]\[0-9\]\[0-9\]\[0-9\] \[0-9\]\[0-9\]:\[0-9\]\[0-9\]:\[0-9\]\[0-9\] \[0-9\]\[0-9\]* l2gi_searchsome\\\(0, 10\\\) called: min is 1" l2g_send "b0 0 10" l2g_send "i0 1 10" l2g_send "b0 1 10" l2g_send "i0 0 100" simple_expect "\[0-9\]\[0-9\]\[0-9\]\[0-9\]\[0-9\]\[0-9\] \[0-9\]\[0-9\]:\[0-9\]\[0-9\]:\[0-9\]\[0-9\] \[0-9\]\[0-9\]* l2gi_searchsome\\\(0, 100\\\) called: min is 1" simple_expect "35:53428" simple_expect "50:57456" l2g_send "b0 0 100" simple_expect "50:57456" simple_expect "35:53428" l2g_send "I1" # Insert 20 numbers in the range 1001..1020, simulating newly created # texts. l2g_send "a1 1001 201613" l2g_send "a1 1002 202864" l2g_send "a1 1003 203254" l2g_send "a1 1004 203935" l2g_send "a1 1005 204444" l2g_send "a1 1006 205551" l2g_send "a1 1007 205859" l2g_send "a1 1008 206390" l2g_send "a1 1009 206784" l2g_send "a1 1010 207002" l2g_send "a1 1011 207212" l2g_send "a1 1012 207324" l2g_send "a1 1013 207469" l2g_send "a1 1014 207571" l2g_send "a1 1015 208471" l2g_send "a1 1016 208592" l2g_send "a1 1017 209959" l2g_send "a1 1018 211141" l2g_send "a1 1019 211225" l2g_send "a1 1020 213738" # Delete the last texts in each block. l2g_send "d1 1010" l2g_send "d1 1020" # Test that stepping past the delete text works. l2g_send "n1 1008" simple_expect "1009" l2g_send "n1 1009" simple_expect "1011" l2g_send "n1 1010" simple_expect "1011" l2g_send "n1 1018" simple_expect "1019" l2g_send "n1 1019" simple_expect "0" l2g_send "n1 1020" simple_expect "0" l2g_send "n1 1021" simple_expect "0" l2g_send "n1 1022" simple_expect "0" l2g_send "i1 1010 1012" simple_expect "1011:207212" l2g_send "b1 1010 1012" simple_expect "1011:207212" l2g_send "i1 1020 0" l2g_send "b1 1020 0" # Trim the blocks one more from the tail. There are now two removed numbers. l2g_send "d1 1009" l2g_send "d1 1019" l2g_send "n1 1007" simple_expect "1008" l2g_send "n1 1008" simple_expect "1011" l2g_send "n1 1009" simple_expect "1011" l2g_send "n1 1010" simple_expect "1011" l2g_send "n1 1017" simple_expect "1018" l2g_send "n1 1018" simple_expect "0" l2g_send "n1 1019" simple_expect "0" l2g_send "n1 1020" simple_expect "0" l2g_send "n1 1021" simple_expect "0" l2g_send "n1 1022" simple_expect "0" l2g_send "i1 1010 1012" simple_expect "1011:207212" l2g_send "b1 1010 1012" simple_expect "1011:207212" l2g_send "i1 1020 0" l2g_send "b1 1020 0" l2g_send "i1 1009 1012" simple_expect "1011:207212" l2g_send "b1 1009 1012" simple_expect "1011:207212" l2g_send "i1 1019 0" l2g_send "b1 1019 0" # Trim the blocks one more from the tail. There are now three removed numbers. l2g_send "d1 1008" l2g_send "d1 1018" l2g_send "n1 1006" simple_expect "1007" l2g_send "n1 1007" simple_expect "1011" l2g_send "n1 1008" simple_expect "1011" l2g_send "n1 1009" simple_expect "1011" l2g_send "n1 1010" simple_expect "1011" l2g_send "n1 1017" simple_expect "0" l2g_send "n1 1018" simple_expect "0" l2g_send "n1 1019" simple_expect "0" l2g_send "n1 1020" simple_expect "0" l2g_send "n1 1021" simple_expect "0" l2g_send "n1 1022" simple_expect "0" l2g_send "i1 1010 1012" simple_expect "1011:207212" l2g_send "b1 1010 1012" simple_expect "1011:207212" l2g_send "i1 1020 0" l2g_send "b1 1020 0" l2g_send "i1 1009 1012" simple_expect "1011:207212" l2g_send "b1 1009 1012" simple_expect "1011:207212" l2g_send "i1 1019 0" l2g_send "b1 1019 0" l2g_send "i1 1008 1012" simple_expect "1011:207212" l2g_send "b1 1008 1012" simple_expect "1011:207212" l2g_send "i1 1018 0" l2g_send "b1 1018 0" # Remove the first entry in the second block l2g_send "d1 1011" l2g_send "n1 1006" simple_expect "1007" l2g_send "n1 1007" simple_expect "1012" l2g_send "n1 1008" simple_expect "1012" l2g_send "n1 1009" simple_expect "1012" l2g_send "n1 1010" simple_expect "1012" l2g_send "n1 1011" simple_expect "1012" l2g_send "i1 1010 1012" l2g_send "b1 1010 1012" l2g_send "i1 1009 1012" l2g_send "b1 1009 1012" l2g_send "i1 1008 1012" l2g_send "b1 1008 1012" l2g_send "i1 1007 1012" simple_expect "1007:205859" l2g_send "b1 1007 1012" simple_expect "1007:205859" l2g_send "i1 1008 1013" simple_expect "1012:207324" l2g_send "b1 1008 1013" simple_expect "1012:207324" # Clear 0. l2g_send "C0" l2g_send "u0" simple_expect "Number of blocks: 0" simple_expect "First unused: 1" l2g_send "D0" l2g_send "D1" l2g_stop