Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make tests which don't need bitcoind faster #543

Merged
merged 9 commits into from
Sep 20, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Convert more stuff
  • Loading branch information
casey committed Sep 20, 2022
commit 5007e16cd5bc805558b868e45837f3b2b39647e8
75 changes: 37 additions & 38 deletions tests/epochs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,45 @@ use super::*;

#[test]
fn empty() {
Test::new()
.args(&["epochs"])
TestCommand::new()
.command("epochs")
.expected_stdout(
"
0
1050000000000000
1575000000000000
1837500000000000
1968750000000000
2034375000000000
2067187500000000
2083593750000000
2091796875000000
2095898437500000
2097949218750000
2098974609270000
2099487304530000
2099743652160000
2099871825870000
2099935912620000
2099967955890000
2099983977420000
2099991988080000
2099995993410000
2099997995970000
2099998997250000
2099999497890000
2099999748210000
2099999873370000
2099999935950000
2099999967240000
2099999982780000
2099999990550000
2099999994330000
2099999996220000
2099999997060000
2099999997480000
2099999997690000
"
.unindent(),
0
1050000000000000
1575000000000000
1837500000000000
1968750000000000
2034375000000000
2067187500000000
2083593750000000
2091796875000000
2095898437500000
2097949218750000
2098974609270000
2099487304530000
2099743652160000
2099871825870000
2099935912620000
2099967955890000
2099983977420000
2099991988080000
2099995993410000
2099997995970000
2099998997250000
2099999497890000
2099999748210000
2099999873370000
2099999935950000
2099999967240000
2099999982780000
2099999990550000
2099999994330000
2099999996220000
2099999997060000
2099999997480000
2099999997690000
",
)
.run();
}
11 changes: 5 additions & 6 deletions tests/supply.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ fn genesis() {
TestCommand::new()
.command("supply")
.expected_stdout(
&"
supply: 2099999997690000
first: 0
last: 2099999997689999
last mined in block: 6929999
"
.unindent(),
supply: 2099999997690000
first: 0
last: 2099999997689999
last mined in block: 6929999
",
)
.run();
}
8 changes: 4 additions & 4 deletions tests/test_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,21 @@ impl TestCommand {

pub(crate) fn expected_stdout(self, expected_stdout: impl AsRef<str>) -> Self {
Self {
expected_stdout: Expected::String(expected_stdout.as_ref().to_owned()),
expected_stdout: Expected::String(expected_stdout.as_ref().unindent()),
..self
}
}

pub(crate) fn stdout_regex(self, expected_stdout: impl AsRef<str>) -> Self {
Self {
expected_stdout: Expected::regex(expected_stdout.as_ref()),
expected_stdout: Expected::regex(&expected_stdout.as_ref().unindent()),
..self
}
}

pub(crate) fn expected_stderr(self, expected_stderr: &str) -> Self {
pub(crate) fn expected_stderr(self, expected_stderr: impl AsRef<str>) -> Self {
Self {
expected_stderr: Expected::String(expected_stderr.to_owned()),
expected_stderr: Expected::String(expected_stderr.as_ref().unindent()),
..self
}
}
Expand Down