package Ġorg . kode in . db . impl . data Ċ Ċ import Ġorg . kode in . db . Value Ċ import Ġorg . kode in . db . data . Data DB Ċ import Ġorg . kode in . db . in Dir Ċ import Ġorg . kode in . db . in memory . in Memory Ċ import Ġorg . kode in . db . test . utils . array Ċ import Ġorg . kode in . db . test . utils . int Ċ import Ġorg . kode in . db . test . utils . ushort Ċ import Ġorg . kode in . memory . file . FileSystem Ċ import Ġorg . kode in . memory . io . as Memory Ċ import Ġkotlin . test . Test Ċ Ċ @ Suppress (" ClassName ") Ċ abstract Ġclass ĠData DB Tests _ 0 1 _ Delete Ġ: ĠData DB Tests () Ġ{ ĊĊĠĠĠ Ġclass ĠL DB Ġ: ĠData DB Tests _ 0 1 _ Delete () Ġ{ Ġoverride Ġval Ġfactory Ġ= ĠData DB . default . in Dir ( FileSystem . temp Directory . path ) Ġ} ĊĠĠĠ Ġclass ĠIM Ġ: ĠData DB Tests _ 0 1 _ Delete () Ġ{ Ġoverride Ġval Ġfactory Ġ= ĠData DB . in Memory Ġ} ĊĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest 0 0 _ Delete Without Index () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġkey Ġ= Ġd db . new Key ( 1 , ĠValue . of (" aaa ", Ġ" bbb ")) ĊĠĠĠĠĠĠĠ Ġd db . put ( key , ĠValue . of (" Value AB ")) ĊĠĠĠĠĠĠĠ Ġd db . delete ( key ) ĊĊĠĠĠĠĠĠĠ Ġassert DB Is ( ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest 0 1 _ Delete With Index () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġkey Ġ= Ġd db . new Key ( 1 , ĠValue . of (" aaa ")) ĊĠĠĠĠĠĠĠ Ġd db . put ( key , ĠValue . of (" Value A ! "), Ġmap Of (" Symbols " Ġto ĠlistOf ( Value . of (" alpha ", Ġ" beta ") Ġto Ġnull ), Ġ" Numbers " Ġto ĠlistOf ( Value . of (" fort y ", Ġ" two ") Ġto ĠValue . of (" Meta Numbers A ")) )) ĊĠĠĠĠĠĠĠ Ġd db . delete ( key ) ĊĊĠĠĠĠĠĠĠ Ġassert DB Is ( ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest 0 2 _ Delete Unknown () Ġ{ ĊĠĠĠĠĠĠĠ Ġd db . put ( ddb . new Key ( 1 , ĠValue . of (" aaa ")), ĠValue . of (" Value A ! "), Ġmap Of (" Symbols " Ġto ĠlistOf ( Value . of (" alpha ", Ġ" beta ") Ġto ĠValue . of (" Meta Symbols A ")) )) ĊĠĠĠĠĠĠĠ Ġval Ġkey Ġ= Ġd db . new Key ( 1 , ĠValue . of (" bbb ")) ĊĠĠĠĠĠĠĠ Ġd db . delete ( key ) ĊĊĠĠĠĠĠĠĠ Ġassert DB Is ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġarray (' i ', Ġ 0 , Ġint ( 1 ), Ġ" Symbols ", Ġ 0 , Ġ" alpha ", Ġ 0 , Ġ" beta ", Ġ 0 , Ġ" aaa ", Ġ 0 ) Ġto Ġarray ( 1 2 8 , Ġushort ( 1 0 ), Ġushort ( 3 ), Ġ" Meta Symbols A "), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġarray (' o ', Ġ 0 , Ġint ( 1 ), Ġ" aaa ", Ġ 0 ) Ġto Ġarray (" Value A ! "), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġarray (' r ', Ġ 0 , Ġint ( 1 ), Ġ" aaa ", Ġ 0 ) Ġto Ġarray ( 1 2 8 , Ġ" Symbols ", Ġ 0 , Ġint ( 1 2 ), Ġushort ( 1 0 ), Ġ" alpha ", Ġ 0 , Ġ" beta ") ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest 0 3 _ Delete 1 of 2 () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġkey Ġ= Ġd db . new Key ( 1 , ĠValue . of (" aaa ")) ĊĠĠĠĠĠĠĠ Ġd db . put ( key , ĠValue . of (" Value A ! "), Ġmap Of (" Symbols " Ġto ĠlistOf ( Value . of (" alpha ", Ġ" beta ") Ġto ĠValue . of (" Meta Symbols A ")) )) ĊĠĠĠĠĠĠĠ Ġd db . put ( ddb . new Key ( 1 , ĠValue . of (" bbb ")), ĠValue . of (" Value B ! "), Ġmap Of (" Numbers " Ġto ĠlistOf ( Value . of (" fort y ", Ġ" two ") Ġto Ġnull ))) ĊĠĠĠĠĠĠĠ Ġd db . delete ( key ) ĊĊĠĠĠĠĠĠĠ Ġassert DB Is ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġarray (' i ', Ġ 0 , Ġint ( 1 ), Ġ" Numbers ", Ġ 0 , Ġ" fort y ", Ġ 0 , Ġ" two ", Ġ 0 , Ġ" bbb ", Ġ 0 ) Ġto Ġarray ( 1 2 8 , Ġushort ( 9 ), Ġushort ( 3 )), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġarray (' o ', Ġ 0 , Ġint ( 1 ), Ġ" bbb ", Ġ 0 ) Ġto Ġarray (" Value B ! "), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġarray (' r ', Ġ 0 , Ġint ( 1 ), Ġ" bbb ", Ġ 0 ) Ġto Ġarray ( 1 2 8 , Ġ" Numbers ", Ġ 0 , Ġint ( 1 1 ), Ġushort ( 9 ), Ġ" fort y ", Ġ 0 , Ġ" two ") ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest 0 4 _ Delete V 0 With Index () Ġ{ ĊĠĠĠĠĠĠĠ Ġd db . kv . put ( array (' o ', Ġ 0 , Ġint ( 1 ), Ġ" aaa ", Ġ 0 ). as Memory (), Ġarray (" Value A ! "). as Memory ()) ĊĠĠĠĠĠĠĠ Ġd db . kv . put ( array (' i ', Ġ 0 , Ġint ( 1 ), Ġ" Symbols ", Ġ 0 , Ġ" alpha ", Ġ 0 , Ġ" beta ", Ġ 0 , Ġ" aaa ", Ġ 0 ). as Memory (), Ġarray (' o ', Ġ 0 , Ġint ( 1 ), Ġ" aaa ", Ġ 0 ). as Memory ()) ĊĠĠĠĠĠĠĠ Ġd db . kv . put ( array (' i ', Ġ 0 , Ġint ( 1 ), Ġ" Numbers ", Ġ 0 , Ġ" fort y ", Ġ 0 , Ġ" two ", Ġ 0 , Ġ" aaa ", Ġ 0 ). as Memory (), Ġarray (' o ', Ġ 0 , Ġint ( 1 ), Ġ" aaa ", Ġ 0 ). as Memory ()) ĊĠĠĠĠĠĠĠ Ġd db . kv . put ( array (' r ', Ġ 0 , Ġint ( 1 ), Ġ" aaa ", Ġ 0 ). as Memory (), Ġarray ( int ( 2 9 ), Ġ' i ', Ġ 0 , Ġint ( 1 ), Ġ" Symbols ", Ġ 0 , Ġ" alpha ", Ġ 0 , Ġ" beta ", Ġ 0 , Ġ" aaa ", Ġ 0 , Ġint ( 2 8 ), Ġ' i ', Ġ 0 , Ġint ( 1 ), Ġ" Numbers ", Ġ 0 , Ġ" fort y ", Ġ 0 , Ġ" two ", Ġ 0 , Ġ" aaa ", Ġ 0 ). as Memory ()) ĊĠĠĠĠĠĠĠ Ġd db . kv . put ( array (' o ', Ġ 0 , Ġint ( 1 ), Ġ" bbb ", Ġ 0 ). as Memory (), Ġarray (" Value B ! "). as Memory ()) ĊĠĠĠĠĠĠĠ Ġd db . kv . put ( array (' i ', Ġ 0 , Ġint ( 1 ), Ġ" Symbols ", Ġ 0 , Ġ" delta ", Ġ 0 , Ġ" gamma ", Ġ 0 , Ġ" bbb ", Ġ 0 ). as Memory (), Ġarray (' o ', Ġ 0 , Ġint ( 1 ), Ġ" bbb ", Ġ 0 ). as Memory ()) ĊĠĠĠĠĠĠĠ Ġd db . kv . put ( array (' r ', Ġ 0 , Ġint ( 1 ), Ġ" bbb ", Ġ 0 ). as Memory (), Ġarray ( int ( 3 0 ), Ġ' i ', Ġ 0 , Ġint ( 1 ), Ġ" Symbols ", Ġ 0 , Ġ" delta ", Ġ 0 , Ġ" gamma ", Ġ 0 , Ġ" bbb ", Ġ 0 ). as Memory ()) ĊĊĠĠĠĠĠĠĠ Ġd db . delete ( ddb . new Key ( 1 , ĠValue . of (" aaa "))) ĊĊĠĠĠĠĠĠĠ Ġassert DB Is ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġarray (' i ', Ġ 0 , Ġint ( 1 ), Ġ" Symbols ", Ġ 0 , Ġ" delta ", Ġ 0 , Ġ" gamma ", Ġ 0 , Ġ" bbb ", Ġ 0 ) Ġto Ġarray (' o ', Ġ 0 , Ġint ( 1 ), Ġ" bbb ", Ġ 0 ), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġarray (' o ', Ġ 0 , Ġint ( 1 ), Ġ" bbb ", Ġ 0 ) Ġto Ġarray (" Value B ! "), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġarray (' r ', Ġ 0 , Ġint ( 1 ), Ġ" bbb ", Ġ 0 ) Ġto Ġarray ( Ġint ( 3 0 ), Ġ' i ', Ġ 0 , Ġint ( 1 ), Ġ" Symbols ", Ġ 0 , Ġ" delta ", Ġ 0 , Ġ" gamma ", Ġ 0 , Ġ" bbb ", Ġ 0 ) ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} Ċ } Ċ