refactor: reorganize source and tests
This commit is contained in:
1 parent
15d76c18a0
commit
c6205a337c
139 files changed
+5532
-5548
No files matched your search
+4
-20
@@ -7,8 +7,8 @@ use clap::ArgMatches;
|
||||
|
||||
use super::utils::{confirm, required_arg};
|
||||
use crate::cli::output::{format_datetime, print_table};
|
||||
use crate::instance::runtime::RunState;
|
||||
use crate::instance::{InstanceManager, ModLoader};
|
||||
use crate::running::RunState;
|
||||
|
||||
type CliResult = Result<(), Box<dyn std::error::Error>>;
|
||||
const LOCAL_CONFIG_PROFILE: &str = "instance default";
|
||||
@@ -143,7 +143,7 @@ async fn launch_instance(matches: &ArgMatches) -> CliResult {
|
||||
// poll until the game process exits. in CLI mode this blocks here
|
||||
// so the user gets a proper exit code at the end.
|
||||
loop {
|
||||
match crate::running::get(name) {
|
||||
match crate::instance::runtime::get(name) {
|
||||
Some(RunState::Crashed(Some(code))) => {
|
||||
println!("Game exited with status {}", code);
|
||||
break;
|
||||
@@ -354,21 +354,5 @@ fn apply_config_update(
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::parse_resolution;
|
||||
|
||||
#[test]
|
||||
fn parses_valid_resolution() {
|
||||
assert_eq!(
|
||||
parse_resolution("1920x1080").expect("should parse"),
|
||||
(1920, 1080)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn rejects_invalid_resolution_format() {
|
||||
assert!(parse_resolution("1920").is_err());
|
||||
assert!(parse_resolution("1920xa").is_err());
|
||||
assert!(parse_resolution("0x1080").is_err());
|
||||
}
|
||||
}
|
||||
#[path = "tests/instance.rs"]
|
||||
mod tests;
|
||||
Reference in new issue
Block a user