Esempio n. 1
0
        public void Snapshot()
        {
            using var log = Log();
            using LevelDB.DB <string, string> db = GetTestDb();
            IIterable <string, string> it        = db.GetIterable().Snapshot();

            db.Delete("a").Delete("c").Delete("m").Delete("n");
            Assert.Equal(
                "a=1;b=2;c=3;l=12;m=13;n=14;x=24;y=25;z=26",
                string.Join(";", it.Select(kv => $"{kv.Key}={kv.Value}")));
            it.Snapshot();
            Assert.Equal(
                "b=2;l=12;x=24;y=25;z=26",
                string.Join(";", it.Select(kv => $"{kv.Key}={kv.Value}")));
        }