Skip to content

Commit

Permalink
Use pretty_assertions in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stanislav-tkach committed Jul 30, 2020
1 parent d0e1ebd commit 9b34398
Show file tree
Hide file tree
Showing 16 changed files with 35 additions and 7 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 2 additions & 0 deletions tests/test_backup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

mod util;

use pretty_assertions::assert_eq;

use rocksdb::{
backup::{BackupEngine, BackupEngineOptions, RestoreOptions},
DB,
Expand Down
2 changes: 2 additions & 0 deletions tests/test_checkpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

mod util;

use pretty_assertions::assert_eq;

use rocksdb::{checkpoint::Checkpoint, Options, DB};
use util::DBPath;

Expand Down
2 changes: 2 additions & 0 deletions tests/test_column_family.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

mod util;

use pretty_assertions::assert_eq;

use rocksdb::{ColumnFamilyDescriptor, MergeOperands, Options, DB, DEFAULT_COLUMN_FAMILY_NAME};
use util::DBPath;

Expand Down
2 changes: 2 additions & 0 deletions tests/test_compationfilter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

mod util;

use pretty_assertions::assert_eq;

use rocksdb::{CompactionDecision, Options, DB};
use util::DBPath;

Expand Down
7 changes: 4 additions & 3 deletions tests/test_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 2 additions & 0 deletions tests/test_iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

mod util;

use pretty_assertions::assert_eq;

use rocksdb::{Direction, IteratorMode, MemtableFactory, Options, DB};
use util::DBPath;

Expand Down
2 changes: 2 additions & 0 deletions tests/test_merge_operator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

mod util;

use pretty_assertions::assert_eq;

use rocksdb::{DBCompactionStyle, MergeOperands, Options, DB};
use util::DBPath;

Expand Down
6 changes: 4 additions & 2 deletions tests/test_multithreaded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@

mod util;

use std::{sync::Arc, thread};

use pretty_assertions::assert_eq;

use rocksdb::DB;
use std::sync::Arc;
use std::thread;
use util::DBPath;

const N: usize = 100_000;
Expand Down
2 changes: 2 additions & 0 deletions tests/test_pinnable_slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

mod util;

use pretty_assertions::assert_eq;

use rocksdb::{Options, DB};
use util::DBPath;

Expand Down
2 changes: 2 additions & 0 deletions tests/test_property.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

mod util;

use pretty_assertions::assert_eq;

use rocksdb::{Options, DB};
use util::DBPath;

Expand Down
2 changes: 2 additions & 0 deletions tests/test_raw_iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

mod util;

use pretty_assertions::assert_eq;

use rocksdb::DB;
use util::DBPath;

Expand Down
3 changes: 2 additions & 1 deletion tests/test_rocksdb_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 2 additions & 0 deletions tests/test_slice_transform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

mod util;

use pretty_assertions::assert_eq;

use rocksdb::{Options, SliceTransform, DB};
use util::DBPath;

Expand Down
3 changes: 2 additions & 1 deletion tests/test_sst_file_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 2 additions & 0 deletions tests/test_write_batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 9b34398

Please sign in to comment.