-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add scaffolding for supporting wal checkpoint
- Loading branch information
Showing
8 changed files
with
177 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
use assert_cmd::cargo::cargo_bin; | ||
use rexpect::error::*; | ||
use rexpect::session::spawn_command; | ||
use std::process; | ||
|
||
#[test] | ||
fn test_pragma_journal_mode_wal() -> Result<(), Error> { | ||
let mut child = spawn_command(run_cli(), Some(1000))?; | ||
child.exp_regex("limbo>")?; // skip everything until limbo cursor appear | ||
child.exp_regex(".?")?; | ||
child.send_line("pragma journal_mode;")?; | ||
child.exp_string("wal")?; | ||
child.send_line(".quit")?; | ||
child.exp_eof()?; | ||
Ok(()) | ||
} | ||
|
||
#[ignore = "wal checkpoint not yet implemented"] | ||
#[test] | ||
fn test_pragma_wal_checkpoint() -> Result<(), Error> { | ||
let mut child = spawn_command(run_cli(), Some(1000))?; | ||
child.exp_regex("limbo>")?; // skip everything until limbo cursor appear | ||
child.exp_regex(".?")?; | ||
child.send_line("pragma wal_checkpoint;")?; | ||
child.exp_string("0|0|0")?; | ||
child.send_line(".quit")?; | ||
child.exp_eof()?; | ||
Ok(()) | ||
} | ||
|
||
fn run_cli() -> process::Command { | ||
let bin_path = cargo_bin("limbo"); | ||
let mut cmd = process::Command::new(bin_path); | ||
cmd | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters