Add persist tests for keyspace creation/deletion

next
Sayan Nandan 3 years ago
parent 08cffa1d3f
commit 9374404551
No known key found for this signature in database
GPG Key ID: 8BC07A0A4D41DD52

2
.gitignore vendored

@ -12,7 +12,5 @@ snapstore.partmap
.sky_pid
.devcontainer
*.deb
server1
server2
.skytest_*
*.pem

@ -24,6 +24,7 @@
*
*/
use sky_macros::dbtest_func as dbtest;
use skytable::{
aio::Connection,
query,
@ -31,6 +32,23 @@ use skytable::{
Element, Query, RespCode,
};
#[dbtest(skip_if_cfg = "persist-suite", norun = true, port = 2007)]
async fn store_keyspace() {
assert_okay!(con, query!("create", "keyspace", "universe"));
switch_entity!(con, "universe");
assert_okay!(con, query!("create", "table", "warp", "keymap(str,str)"));
switch_entity!(con, "universe:warp");
assert_okay!(con, query!("set", "x", "100"));
}
#[dbtest(run_if_cfg = "persist-suite", norun = true, port = 2007)]
async fn load_keyspace() {
switch_entity!(con, "universe:warp");
runeq!(con, query!("get", "x"), Element::String("100".to_owned()));
switch_entity!(con, "default");
assert_okay!(con, query!("drop", "table", "universe:warp"));
assert_okay!(con, query!("drop", "keyspace", "universe"));
}
macro_rules! bin {
($input:expr) => {{
const INVALID_SEQ: [u8; 2] = *b"\x80\x81";

Loading…
Cancel
Save