Skip to content

Commit

Permalink
even more testcase spelling consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
Andriamanitra committed May 19, 2024
1 parent fd42dc4 commit 8c7c285
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/clash/testcase.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use serde::{Deserialize, Deserializer, Serialize};

/// `TestCase` is a deserialized representation of a test case for a Clash of
/// `Testcase` is a deserialized representation of a testcase for a Clash of
/// Code or I/O puzzle.
#[derive(Debug, Deserialize, Serialize, Clone)]
pub struct Testcase {
Expand All @@ -16,7 +16,7 @@ pub struct Testcase {
/// `test_out` is the output that a solution is expected to print to STDOUT
#[serde(rename = "testOut")]
pub test_out: String,
/// `is_validator` is true for test cases that are not normally visible when
/// `is_validator` is true for testcases that are not normally visible when
/// solving a puzzle on CodinGame.
#[serde(rename = "isValidator")]
pub is_validator: bool,
Expand Down
2 changes: 1 addition & 1 deletion src/internal/outputstyle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ impl OutputStyle {
println!("{}\n{}\n", self.title.paint("Constraints:"), format_cg(constraints, self));
}

let example = clash.testcases().first().expect("example puzzle should have at least one test case");
let example = clash.testcases().first().expect("example puzzle should have at least one testcase");
println!(
"{}\n{}\n{}\n{}",
self.title.paint("Example:"),
Expand Down
10 changes: 5 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ fn cli() -> clap::Command {
.value_parser(value_parser!(f64))
.default_value("5")
)
.arg(arg!(--"auto-advance" "automatically move on to next clash if all test cases pass"))
.arg(arg!(--"auto-advance" "automatically move on to next clash if all testcases pass"))
.arg(arg!(--"ignore-failures" "run all tests despite failures"))
.arg(
arg!(--"testcases" <TESTCASE_INDICES> "indices of the testcases to run (separated by commas)")
Expand All @@ -103,8 +103,8 @@ fn cli() -> clap::Command {
.value_parser(value_parser!(PublicHandle))
)
.after_help(
"If a --build-command is specified, it will be executed once before running any of the test cases. \
The --command is required and will be executed once per test case.\
"If a --build-command is specified, it will be executed once before running any of the testcases. \
The --command is required and will be executed once per testcase.\
\nIMPORTANT: The commands you provide will be executed without any sandboxing. Only run code you trust!"
)
)
Expand Down Expand Up @@ -435,8 +435,8 @@ impl App {
Some(x) => x,
None => {
return Err(anyhow!(
"Invalid testcase index {idx} (the current clash only has {num_testcases} test cases)"
))
"Invalid testcase index {idx} (the current clash only has {num_testcases} testcases)"
))
}
};

Expand Down
4 changes: 2 additions & 2 deletions src/solution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use wait_timeout::ChildExt;

use crate::clash::Testcase;

/// Run a command against test cases one at a time.
/// Run a command against testcases one at a time.
///
/// # Examples
///
Expand Down Expand Up @@ -46,7 +46,7 @@ pub fn lazy_run<'a>(
})
}

/// Run a command against a single test case.
/// Run a command against a single testcase.
pub fn run_testcase(test: &Testcase, run_command: &mut Command, timeout: &Duration) -> TestResult {
let mut run = match run_command
.stdin(std::process::Stdio::piped())
Expand Down
6 changes: 3 additions & 3 deletions src/solution/test_result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ pub enum CommandExit {
Timeout,
}

/// Represents the outcome of running a test case. [TestResult::Success] means
/// Represents the outcome of running a testcase. [TestResult::Success] means
/// the output of a solution command matched the `test_out` field of the
/// [TestCase](crate::clash::TestCase).
/// [Testcase](crate::clash::Testcase).
#[derive(Debug, Clone)]
pub enum TestResult {
/// Solution command produced the expected output. A test run is considered
Expand Down Expand Up @@ -48,7 +48,7 @@ impl TestResult {
}
}

/// Returns true if the test case passed. A test case passes if the output
/// Returns true if the testcase passed. A testcase passes if the output
/// of the solution command matches the expected output.
pub fn is_success(&self) -> bool {
matches!(self, TestResult::Success)
Expand Down

0 comments on commit 8c7c285

Please sign in to comment.