Skip to content

Commit 0306e4e

Browse files
committed
Tests and misc fixes
1 parent 9dc8db5 commit 0306e4e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

convex-core/src/main/java/convex/core/data/Address.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public final class Address extends ABlobLike<CVMLong> {
3333
/**
3434
* The Zero Address
3535
*/
36-
public static final Address ZERO = Address.create(0);
36+
public static final Address ZERO = CACHE[0];
3737

3838
/**
3939
* The maximum possible Address

convex-core/src/test/java/convex/core/data/IndexTest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public void testEmpty() throws InvalidDataException {
3434
assertFalse(m.containsValue(null));
3535

3636
assertEquals(0L, m.count());
37+
assertEquals(0L, m.getDepth());
3738
assertSame(m, m.dissoc(Blob.fromHex("cafe")));
3839
assertSame(m, m.dissoc(Blob.fromHex("")));
3940

@@ -98,7 +99,9 @@ public void testGet() throws InvalidDataException {
9899
assertNull(m.get(Samples.MAX_EMBEDDED_STRING)); // needs a blob. String counts as non-existent key
99100
assertCVMEquals(17L,m.get(k1));
100101

101-
assertNull(m.get((Object)null)); // Null counts as non-existent key when used as an Object arg
102+
// Null counts as non-existent key when used as an Object arg
103+
assertNull(m.get((Object)null));
104+
assertNull(m.get((ACell)null));
102105
}
103106

104107

@@ -238,6 +241,7 @@ public void testSingleEntry() throws InvalidDataException {
238241
CVMLong val=RT.cvm(177777L);
239242
Index<ABlob, CVMLong> m = Index.create(k, val);
240243
assertEquals(1L, m.count());
244+
assertEquals(4, m.getDepth());
241245

242246
assertEquals(val, m.get(k));
243247

0 commit comments

Comments
 (0)