mirror of
https://github.com/theoludwig/advent_of_code.git
synced 2025-05-18 19:27:51 +02:00
ci: add automated tests/linting/format
This commit is contained in:
1
day_2/.gitignore
vendored
Normal file
1
day_2/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/target
|
6
day_2/Cargo.toml
Normal file
6
day_2/Cargo.toml
Normal file
@ -0,0 +1,6 @@
|
||||
[package]
|
||||
name = "day_2"
|
||||
version = "1.0.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
7
day_2/README.md
Normal file
7
day_2/README.md
Normal file
@ -0,0 +1,7 @@
|
||||
# - Day 2 -
|
||||
|
||||
Source: <https://adventofcode.com/2023/day/2>
|
||||
|
||||
## Instructions - Part 1
|
||||
|
||||
## Instructions - Part 2
|
18
day_2/src/main.rs
Normal file
18
day_2/src/main.rs
Normal file
@ -0,0 +1,18 @@
|
||||
fn part_1() -> i32 {
|
||||
142
|
||||
}
|
||||
|
||||
fn main() {
|
||||
println!("- Day 2: Title -");
|
||||
println!("Answer Part 1: {}", part_1());
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod day_2_tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_part_1_example() {
|
||||
assert_eq!(142, part_1());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user