Use pretty_assertions in tests (#451)

master
Stanislav Tkach 4 years ago committed by GitHub
parent d0e1ebd801
commit 4a064d0f72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      Cargo.toml
  2. 2
      tests/test_backup.rs
  3. 26
      tests/test_checkpoint.rs
  4. 2
      tests/test_column_family.rs
  5. 2
      tests/test_compationfilter.rs
  6. 7
      tests/test_db.rs
  7. 2
      tests/test_iterator.rs
  8. 2
      tests/test_merge_operator.rs
  9. 4
      tests/test_multithreaded.rs
  10. 2
      tests/test_pinnable_slice.rs
  11. 2
      tests/test_property.rs
  12. 2
      tests/test_raw_iterator.rs
  13. 3
      tests/test_rocksdb_options.rs
  14. 2
      tests/test_slice_transform.rs
  15. 3
      tests/test_sst_file_writer.rs
  16. 2
      tests/test_write_batch.rs

@ -32,3 +32,4 @@ librocksdb-sys = { path = "librocksdb-sys", version = "6.10.2" }
[dev-dependencies]
trybuild = "1.0.21"
tempfile = "3.1.0"
pretty_assertions = "0.6.1"

@ -14,6 +14,8 @@
mod util;
use pretty_assertions::assert_eq;
use rocksdb::{
backup::{BackupEngine, BackupEngineOptions, RestoreOptions},
DB,

@ -14,6 +14,8 @@
mod util;
use pretty_assertions::assert_eq;
use rocksdb::{checkpoint::Checkpoint, Options, DB};
use util::DBPath;
@ -41,10 +43,10 @@ pub fn test_single_checkpoint() {
// Verify checkpoint
let cp = DB::open_default(&cp1_path).unwrap();
assert_eq!(*cp.get(b"k1").unwrap().unwrap(), *b"v1");
assert_eq!(*cp.get(b"k2").unwrap().unwrap(), *b"v2");
assert_eq!(*cp.get(b"k3").unwrap().unwrap(), *b"v3");
assert_eq!(*cp.get(b"k4").unwrap().unwrap(), *b"v4");
assert_eq!(cp.get(b"k1").unwrap().unwrap(), b"v1");
assert_eq!(cp.get(b"k2").unwrap().unwrap(), b"v2");
assert_eq!(cp.get(b"k3").unwrap().unwrap(), b"v3");
assert_eq!(cp.get(b"k4").unwrap().unwrap(), b"v4");
}
#[test]
@ -71,10 +73,10 @@ pub fn test_multi_checkpoints() {
// Verify checkpoint
let cp = DB::open_default(&cp1_path).unwrap();
assert_eq!(*cp.get(b"k1").unwrap().unwrap(), *b"v1");
assert_eq!(*cp.get(b"k2").unwrap().unwrap(), *b"v2");
assert_eq!(*cp.get(b"k3").unwrap().unwrap(), *b"v3");
assert_eq!(*cp.get(b"k4").unwrap().unwrap(), *b"v4");
assert_eq!(cp.get(b"k1").unwrap().unwrap(), b"v1");
assert_eq!(cp.get(b"k2").unwrap().unwrap(), b"v2");
assert_eq!(cp.get(b"k3").unwrap().unwrap(), b"v3");
assert_eq!(cp.get(b"k4").unwrap().unwrap(), b"v4");
// Change some existing keys
db.put(b"k1", b"modified").unwrap();
@ -92,8 +94,8 @@ pub fn test_multi_checkpoints() {
// Verify second checkpoint
let cp = DB::open_default(&cp2_path).unwrap();
assert_eq!(*cp.get(b"k1").unwrap().unwrap(), *b"modified");
assert_eq!(*cp.get(b"k2").unwrap().unwrap(), *b"changed");
assert_eq!(*cp.get(b"k5").unwrap().unwrap(), *b"v5");
assert_eq!(*cp.get(b"k6").unwrap().unwrap(), *b"v6");
assert_eq!(cp.get(b"k1").unwrap().unwrap(), b"modified");
assert_eq!(cp.get(b"k2").unwrap().unwrap(), b"changed");
assert_eq!(cp.get(b"k5").unwrap().unwrap(), b"v5");
assert_eq!(cp.get(b"k6").unwrap().unwrap(), b"v6");
}

@ -14,6 +14,8 @@
mod util;
use pretty_assertions::assert_eq;
use rocksdb::{ColumnFamilyDescriptor, MergeOperands, Options, DB, DEFAULT_COLUMN_FAMILY_NAME};
use util::DBPath;

@ -14,6 +14,8 @@
mod util;
use pretty_assertions::assert_eq;
use rocksdb::{CompactionDecision, Options, DB};
use util::DBPath;

@ -14,15 +14,16 @@
mod util;
use std::{mem, sync::Arc, thread, time::Duration};
use pretty_assertions::assert_eq;
use rocksdb::{
perf::get_memory_usage_stats, BlockBasedOptions, BottommostLevelCompaction, Cache,
CompactOptions, DBCompactionStyle, Env, Error, FifoCompactOptions, IteratorMode, Options,
PerfContext, PerfMetric, ReadOptions, SliceTransform, Snapshot, UniversalCompactOptions,
UniversalCompactionStopStyle, WriteBatch, DB,
};
use std::sync::Arc;
use std::time::Duration;
use std::{mem, thread};
use util::DBPath;
#[test]

@ -14,6 +14,8 @@
mod util;
use pretty_assertions::assert_eq;
use rocksdb::{Direction, IteratorMode, MemtableFactory, Options, DB};
use util::DBPath;

@ -14,6 +14,8 @@
mod util;
use pretty_assertions::assert_eq;
use rocksdb::{DBCompactionStyle, MergeOperands, Options, DB};
use util::DBPath;

@ -14,9 +14,9 @@
mod util;
use std::{sync::Arc, thread};
use rocksdb::DB;
use std::sync::Arc;
use std::thread;
use util::DBPath;
const N: usize = 100_000;

@ -14,6 +14,8 @@
mod util;
use pretty_assertions::assert_eq;
use rocksdb::{Options, DB};
use util::DBPath;

@ -14,6 +14,8 @@
mod util;
use pretty_assertions::assert_eq;
use rocksdb::{Options, DB};
use util::DBPath;

@ -14,6 +14,8 @@
mod util;
use pretty_assertions::assert_eq;
use rocksdb::DB;
use util::DBPath;

@ -14,8 +14,9 @@
mod util;
use rocksdb::{BlockBasedOptions, DataBlockIndexType, Options, ReadOptions, DB};
use std::{fs, io::Read as _};
use rocksdb::{BlockBasedOptions, DataBlockIndexType, Options, ReadOptions, DB};
use util::DBPath;
#[test]

@ -14,6 +14,8 @@
mod util;
use pretty_assertions::assert_eq;
use rocksdb::{Options, SliceTransform, DB};
use util::DBPath;

@ -14,8 +14,9 @@
mod util;
use rocksdb::{Error, Options, SstFileWriter, DB};
use pretty_assertions::assert_eq;
use rocksdb::{Error, Options, SstFileWriter, DB};
use util::DBPath;
#[test]

@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use pretty_assertions::assert_eq;
use rocksdb::WriteBatch;
#[test]

Loading…
Cancel
Save