Skip to content
This repository was archived by the owner on May 14, 2025. It is now read-only.

Commit a311f0e

Browse files
committed
chore: test and update spec.json
1 parent 4485eb4 commit a311f0e

File tree

5 files changed

+972
-768
lines changed

5 files changed

+972
-768
lines changed

rust/Cargo.lock

Lines changed: 71 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/tool/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,6 @@ util = { path = "../util" }
4646
uuid = { version = "1.10.0", features = ["serde"] }
4747

4848
[dev-dependencies]
49+
assert_cmd = "2.0.16"
4950
expect-test = "1.5.0"
5051
stack_list = "0.1.0"

rust/tool/src/main.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,9 @@ fn main() -> anyhow::Result<()> {
184184
}
185185
None => false,
186186
});
187+
openrpc
188+
.methods
189+
.sort_by(|left, right| left.name.cmp(&right.name));
187190
gc::prune_schemas(&mut openrpc)?;
188191
if let Ok(missed) = nunny::Vec::new(
189192
select

rust/tool/tests/snapshot.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
use assert_cmd::Command;
2+
3+
#[test]
4+
fn openrpc_select_is_up_to_date() -> anyhow::Result<()> {
5+
let repo_root = concat!(env!("CARGO_MANIFEST_DIR"), "/../..");
6+
let stdout = Command::cargo_bin("tool")?
7+
.args(["openrpc", "select"])
8+
.args([
9+
"schemas/forest-6ba5c966097-path-v0.json",
10+
"misc/method-list.json",
11+
])
12+
.current_dir(repo_root) // root of repo
13+
.assert()
14+
.success()
15+
.get_output()
16+
.stdout
17+
.clone();
18+
let stdout = String::from_utf8(stdout)?;
19+
expect_test::expect_file![format!("{repo_root}/spec.json")].assert_eq(&stdout);
20+
Ok(())
21+
}

0 commit comments

Comments
 (0)