summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2021-12-21 17:22:22 -0500
committerJesse Luehrs <doy@tozt.net>2021-12-21 17:22:22 -0500
commite82a8cdfe29b3960095848fe9d2fdcbfd39a4ff3 (patch)
tree18ce633739e7748ed194a4eb4c24b263d7e5ca20
parent17b710ecb1039e9343e01a50620e763580c9ec90 (diff)
downloadadvent-of-code-e82a8cdfe29b3960095848fe9d2fdcbfd39a4ff3.tar.gz
advent-of-code-e82a8cdfe29b3960095848fe9d2fdcbfd39a4ff3.zip
also stub out tests
-rwxr-xr-xbin/stub-code12
1 files changed, 12 insertions, 0 deletions
diff --git a/bin/stub-code b/bin/stub-code
index 5a3bc8c..1212e33 100755
--- a/bin/stub-code
+++ b/bin/stub-code
@@ -24,6 +24,18 @@ pub fn part1(_: Todo) -> Result<i64> {
pub fn part2(_: Todo) -> Result<i64> {
todo!()
}
+
+#[test]
+fn test() {
+ assert_eq!(
+ part1(parse(parse::data($year, $day).unwrap()).unwrap()).unwrap(),
+ 0
+ );
+ assert_eq!(
+ part2(parse(parse::data($year, $day).unwrap()).unwrap()).unwrap(),
+ 0
+ );
+}
EOF
perl -pi -E"\$seen_mod = 1 if /mod day$day/; if (!\$seen_mod && /NEXT MOD/) { say '#[path = \"$day/mod.rs\"]'; say 'mod day$day;'; }" src/"$year"/mod.rs