Skip to content

Commit 9603af0

Browse files
committed
Implement volpage for report.rs and update example toml.
Issue #3
1 parent 30d494c commit 9603af0

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

src/identifiers.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ impl From<&str> for SuttaplexUid {
5050
#[derive(Clone, Deserialize, Debug, PartialEq)]
5151
pub struct VolpageReference(String);
5252

53+
impl Display for VolpageReference {
54+
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
55+
write!(f, "{}", self.0)
56+
}
57+
}
58+
5359
impl From<&str> for VolpageReference {
5460
fn from(value: &str) -> Self {
5561
Self(String::from(value))

src/report.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl TestResult {
4949
SearchResults::Volpage {
5050
expected,
5151
results: _,
52-
} => todo!(),
52+
} => format!("Volpage hit {expected}"),
5353
}
5454
}
5555

suite_examples/volpage.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,9 @@ selected-languages = ["en", "pli"]
1212
description = "Find volpage:SN ii 4"
1313
query = "volpage:SN ii 4"
1414
expected.volpage = "PTS SN ii 1"
15-
# expected.min_rank = 1
15+
16+
[[test-case]]
17+
description = "Find and rank volpage:SN ii 4"
18+
query = "volpage:SN ii 4"
19+
expected.volpage = "PTS SN ii 4"
20+
expected.min-rank = 3

0 commit comments

Comments
 (0)