Test: Playfield test

This commit is contained in:
Jonas Zeunert
2024-02-16 18:50:37 +01:00
parent 870a062b19
commit 31bc601dfd

View File

@@ -3,9 +3,13 @@ use clap::{Parser, Subcommand};
#[derive(Parser)]
#[command(version, about, long_about = None)]
struct Cli {
// The sudoku field given as a 1x81 string from left to right, top to bottom, 0 denotes value
// The sudoku field given as a space separated string from left to right, top to bottom, 0 denotes value
// absense
field: String,
// Size of one size of the field. For standard 3x3 input 3 (default)
#[arg(short, long)]
field_size: u16,
}
struct Playfield {
@@ -21,14 +25,22 @@ struct Field {
fn main() {
let cli = Cli::parse();
let playfield = parse_field(&cli.field);
let playfield = parse_playfield(&cli.field, cli.field_size);
println!("Hello, world!");
}
fn parse_field(field: &String) -> Playfield {}
fn parse_playfield(field: &String, field_size: u16) -> Playfield {}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_parse_field() {}
fn test_parse_field() {
let input = "1 2 3 0 0 0 1 2 3";
let field_size = 2;
let playfield = parse_playfield(&input.to_string(), field_size);
}
}