Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
ben221199 committed Sep 11, 2024
1 parent 549f67c commit a49de20
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main/java/com/lbry/database/PrefixDB.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,22 @@
import com.lbry.database.revert.RevertibleOperationStack;
import com.lbry.database.revert.RevertiblePut;
import com.lbry.database.rows.*;
import org.rocksdb.*;

import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;

import org.rocksdb.ColumnFamilyDescriptor;
import org.rocksdb.ColumnFamilyHandle;
import org.rocksdb.DBOptions;
import org.rocksdb.Options;
import org.rocksdb.ReadOptions;
import org.rocksdb.RocksDB;
import org.rocksdb.RocksDBException;
import org.rocksdb.RocksIterator;

/**
* Class for a revertible RocksDB database: A RocksDB database where each set of applied changes can be undone.
*/
Expand Down
17 changes: 17 additions & 0 deletions src/test/java/com/lbry/database/tests/PrefixTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.lbry.database.tests;

import com.lbry.database.Prefix;

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;

public class PrefixTest{

@Test
public void testDecodeEmptyJSON(){
assertEquals('K',Prefix.CLAIM_TO_SUPPORT.getValue());
assertEquals('L',Prefix.SUPPORT_TO_CLAIM.getValue());
}

}

0 comments on commit a49de20

Please sign in to comment.