Skip to content

Commit

Permalink
Update input handling for tests too
Browse files Browse the repository at this point in the history
  • Loading branch information
jakcharvat committed Dec 5, 2024
1 parent 0b7ebb9 commit cf810a5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions day01/test/day01_test.gleam
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import gleam/result
import gleam/string
import gleeunit
import gleeunit/should
Expand All @@ -6,8 +7,9 @@ import simplifile
import day01

fn input() -> String {
let assert Ok(input) = simplifile.read("small-in.txt")
input |> string.trim
simplifile.read("small-in.txt")
|> result.lazy_unwrap(fn() { panic })
|> string.trim
}

pub fn main() {
Expand Down
6 changes: 4 additions & 2 deletions templates/day_test.gleam
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import gleam/result
import gleam/string
import gleeunit
import gleeunit/should
Expand All @@ -6,8 +7,9 @@ import simplifile
import day__DAY_NUM__

fn input() -> String {
let assert Ok(input) = simplifile.read("small-in.txt")
input |> string.trim
simplifile.read("small-in.txt")
|> result.lazy_unwrap(fn() { panic })
|> string.trim
}

pub fn main() {
Expand Down

0 comments on commit cf810a5

Please sign in to comment.