Commit 17e3279fdc5e46feb844130000299eaf7ca03d0a
added test for deletion after flush
Signed-off-by: wanderer <mjbecze@gmail.com>wanderer committed on 8/10/2017, 10:28:37 PM
Parent: f7a487bb920714294215da003b16aa40d0a676a2
Files changed
index.js | changed |
tests/index.js | changed |
index.js | ||
---|---|---|
@@ -190,8 +190,9 @@ | ||
190 | 190 … | } else { |
191 | 191 … | let branch = getBranch(parent) |
192 | 192 … | branch = branch.map(node => node === root ? null : node) |
193 | 193 … | setBranch(parent, branch) |
194 … | + await this.graph.tree(parent, 2) | |
194 | 195 … | |
195 | 196 … | joinNodes(parent) |
196 | 197 … | } |
197 | 198 … | } |
tests/index.js | |||
---|---|---|---|
@@ -133,14 +133,17 @@ | |||
133 | 133 … | const key = crypto.createHash('sha256').update(i.toString()).digest().slice(0, 20) | |
134 | 134 … | await tree.set(key, i) | |
135 | 135 … | } | |
136 | 136 … | ||
137 … | + await tree.flush() | ||
138 … | + | ||
137 | 139 … | for (let i = 0; i < entries; i++) { | |
138 | 140 … | const key = crypto.createHash('sha256').update(i.toString()).digest().slice(0, 20) | |
139 | 141 … | const value = await tree.get(key) | |
140 | 142 … | t.equals(value, i) | |
141 | 143 … | } | |
142 | 144 … | ||
145 … | + await tree.flush() | ||
143 | 146 … | for (let i = 0; i < entries; i++) { | |
144 | 147 … | const key = crypto.createHash('sha256').update(i.toString()).digest().slice(0, 20) | |
145 | 148 … | await tree.delete(key) | |
146 | 149 … | } |
Built with git-ssb-web