From db68f37bd1517fb922c03d9ee6bc03a9980a8726 Mon Sep 17 00:00:00 2001 From: tinger Date: Tue, 23 Jul 2024 21:26:24 +0200 Subject: [PATCH] fix(cli): Remove unused code - Remove unused fucntions in `cli::test` and `cli::report`. - Mark functions in `cli::project` as allow(dead_code), these will be required once editing is implemented. --- crates/typst-test-cli/src/project.rs | 4 ++++ crates/typst-test-cli/src/report.rs | 9 --------- crates/typst-test-cli/src/test.rs | 9 --------- 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/crates/typst-test-cli/src/project.rs b/crates/typst-test-cli/src/project.rs index b88bc35..590969a 100644 --- a/crates/typst-test-cli/src/project.rs +++ b/crates/typst-test-cli/src/project.rs @@ -84,6 +84,7 @@ impl Project { &self.tests } + #[allow(dead_code)] pub fn matched_mut(&mut self) -> &mut BTreeMap { &mut self.tests } @@ -92,6 +93,7 @@ impl Project { &self.filtered } + #[allow(dead_code)] pub fn filtered_mut(&mut self) -> &mut BTreeMap { &mut self.filtered } @@ -119,6 +121,7 @@ impl Project { self.resolver.test_root() } + #[allow(dead_code)] pub fn root_exists(&self) -> io::Result { self.resolver.project_root().try_exists() } @@ -127,6 +130,7 @@ impl Project { self.resolver.test_root().try_exists() } + #[allow(dead_code)] pub fn unique_test(&self) -> Result<&Test, ()> { if self.tests.len() != 1 { return Err(()); diff --git a/crates/typst-test-cli/src/report.rs b/crates/typst-test-cli/src/report.rs index d24afdc..b24fdfa 100644 --- a/crates/typst-test-cli/src/report.rs +++ b/crates/typst-test-cli/src/report.rs @@ -42,10 +42,6 @@ impl Summary { self.passed == self.run() } - pub fn is_partial_fail(&self) -> bool { - self.passed < self.run() - } - pub fn is_total_fail(&self) -> bool { self.passed == 0 } @@ -200,11 +196,6 @@ impl Reporter { Ok(()) } - pub fn tests_added(&mut self, project: &Project) -> io::Result<()> { - self.tests_success(project, "added")?; - Ok(()) - } - pub fn test_added(&mut self, test: &Test) -> io::Result<()> { self.test_success(test, "added")?; Ok(()) diff --git a/crates/typst-test-cli/src/test.rs b/crates/typst-test-cli/src/test.rs index d3b5f21..568f792 100644 --- a/crates/typst-test-cli/src/test.rs +++ b/crates/typst-test-cli/src/test.rs @@ -46,15 +46,6 @@ pub enum TestFailure { Comparison(#[from] CompareFailure), } -impl TestFailure { - pub fn stage(&self) -> Stage { - match self { - TestFailure::Compilation(_) => Stage::Compilation, - TestFailure::Comparison(_) => Stage::Comparison, - } - } -} - #[derive(Debug, Clone, thiserror::Error)] #[error("compilation failed")] pub struct CompileFailure {